請問有關TCPIP傳檔的問題 |
答題得分者是:turboted
|
boring11
一般會員 發表:10 回覆:7 積分:3 註冊:2003-04-04 發送簡訊給我 |
請問:
ClientSocket1.Socket.SendStream
ClientSocket1.Socket.SendBuf
這兩個有什麼差別............
SERVE都可以用Socket.ReceiveBuf這個來收ㄇ
ClientSocket1.Socket.SendStreamThenDrop
還有這個是幹ㄇ的.....看不懂ㄝ 還有剛剛看了PORT的問題請問
TCPIP的PORT不同有差別ㄇ
看到有人說傳檔案用一個PORT
傳命令用另一個PORT
這樣SERVE如何判斷是哪個PORT的阿.... 拜託各位大大幫忙......謝謝......
|
turboted
版主 發表:95 回覆:754 積分:452 註冊:2002-07-23 發送簡訊給我 |
關於SendStream和SendBuf的不同
我想help on line 說的相當的明白
Use SendBuf to write to the socket connection. Call this method from the OnSocketEvent event handler of a Windows socket object or in the OnWrite or OnClientWrite event handler of a socket component. Alternately, Use SendBuf to write when a connection is first formed when the socket does not expect notification that the socket on the other end of the connection is expecting to read. For non-blocking sockets, the data is sent to the WinSock DLL which has it's own internal buffers. If the WinSock can accept additional data, SendBuf returns immediately with the number of bytes queued. If the WinSock internal buffer space is not able to accept the buffer being sent, SendBuf returns -1 and no data is queued at all. In this case, wait a bit for the WinSock to have a chance to send out already-queued data; then try again. For blocking sockets, SendBuf returns the number of bytes actually written. If an error occurs while writing to the connection, SendBuf terminates the connection and throws an ESocketError exception. Use SendStream to write to the socket connection. The writing may occur in the OnSocketEvent event handler of a Windows socket object or in the OnWrite or OnClientWrite event handler of a socket component. Alternately, SendStream may write from a socket that is expected to write to the connection without a notification to signal the connections readiness to read. SendStream reads information from the stream indicated by AStream and writes it to the socket connection. The value returned by SendStream indicates whether any information was successfully written to the connection. Note: The Stream passed as a parameter to SendStream becomes o wned?by the windows socket object. The Windows socket object frees the stream when it is finished with it. Do not attempt to free the stream after it has been passed as a parameter.SendStreamThenDrop的說明 Use SendStreamThenDrop to write to a socket connection when the connection is no longer needed after the writing is complete. SendStream reads information from the stream indicated by AStream and writes it to the socket connection, shutting down the connection when it is done. The value returned by SendStream indicates whether any information was successfully written to the connection. Note: The Stream passed as a parameter to SendStream becomes o wned?by the windows socket object. The Windows socket object frees the stream when it is finished with it. Do not attempt to free the stream after it has been passed as a parameter.你問到ReceiveBuf都可收嗎,答案,可以.. port的問題請看網路概論的書 就像ftp來說,也是需要同時開兩個port 發表人 - turboted 於 2003/06/21 12:12:54 |
本站聲明 |
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。 2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。 3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇! |