Closed 604980670 closed 6 months ago
Hi @604980670 ,
Tcp.NET doesn't modify the header and instead relies on .NET's Socket class to manage header. The RFC is here: https://www.ietf.org/rfc/rfc793.txt. To remain consistent with other TCP client/servers in other frameworks, it would be best not to modify something like the standard header and its implementation.
Tcp is a persistent connection and data flows the .NET framework as a stream. Every tick, the data received on the stream is dumped into an in-memory buffer and parsed for the end of line bytes. If the end of line bytes are found, the in-memory buffer is clipped and the buffered byte array is emit as an event. It's standard practice to use some end of line byte or byte array to signify end of message for raw Tcp / Udp connections, and in your case, it appears the recommended "\r\n" (carriage return new line) is a conflict.
There are a couple options that can help you without modifying the Tcp protocol:
Please let me know if this helps, if you have any questions, and or anything I can assist with.
Thank you again for using Tcp.NET! Rob
Thanks
There is a fatal bug when using this plugin to transfer byte[] that is, the separator is easy to confuse with the content, can you propose a new solution, that is, put the length of the content in the header when sending, and get it according to the length when intercepting the content