.net - TcpClient - how to determine when bytes are delivered? -
When using TcpClient, how do I know what the server is or is not found? For example, let's say my message is a long string: And I want to completely close the string with TCP, and I want to know that the entire string was distributed and received by the server. There are some common methods of sending data through TCP: You need to get approval on the other side. Option: Sending alone does not guarantee delivery. string myAppMessage = "long coding, bla, bla, bla, ....." byte [] allBytes = Encoding ASCII.GetBytes (myAppMessage);
var client = new TCP client (IP_ADDR, PART) client. Gatestream () Type (all beta) >
In the first case, do I call it on the stream after calling it
flush () Is given? I think one or both of the above calls are blocked. If it is complete without exception, can I understand that the whole message was received / received?
shutdown (read) connection. Call
Read until it returns 0. 0 signal that the remote side has closed and all the data has been received.
Comments
Post a Comment