Thursday 15 January 2015

vb.net - There's a way know when a TCP payload ends? -


Text after "div class =" itemprop = "text">

I have to send a data on a regular TCP and have to wait a response on the same opened socket. The data receiver does not fit into a TCP message, therefore, this code will wait until the last byte or should I finally have to add some signal?

NetworkStream = Nothing is as slow as CloseStream Try Boolean = False Linger LingerMode as New LingerOption (True, 5) As the ASCII String Retard Response Data to Store Reactive Response [ String] = [st Ing] .Empty Tx.NoDelay = True Tx.LingerState = LingerMode Tx.SendTimeout = 10000 Tx.ReceiveTimeout = 10000 Tx.Connect (host, port) is the translation of the message passed in ASCII and store it as a byte array Receive a client stream to read and write [byte] () = System.Text.Encoding.ASCII.GetBytes (MSG) as a dim data. 'Stream stream = client. Gatestream (); Send Message to TCpServer - stream = Tx.GetStream () CloseStream = True 'stream.WriteTimeout = 100' Stream Write (data, 0, data length) 'tx Read the first batch of 'TCP server response bytes' buffer data = new [byte] (256) {}' to connect 'Receive TcpServer.response' response bytes. Darem bytes int 32 = In the form of the stream. Read (data, 0, data. Lamps) response data = systemtext Encoding. ASCIIGetstrings (data, 0, bytes) if closestream = True is the stream. Close () and close the Tx () Return return data as Capture Exposure Liberation (formerly message, color .rd) WriteRTLLog (e.g., StackTrace, Color. Darkdard) "Error" and return to end and pf function

I have never done an application to get more than one TCP packet before that, so I do not know what to expect as much as I want, that is 524 KB

is

No comments:

Post a Comment