Framing TCP streams in SGS

Hi

Most of my messages are way way way less than the maximum packet size in TCP. Using NIO if I don’t set the no delay on the tcp socket, then I may get more than one message arriving at the same time server side. When I read the bytearray it may contain the end of the last message receieved, followed by any number of whole messages, followed by the start of a message. This means I need to put message lengths in so that I can read the right number of bytes off, or save them for the rest of the message to arrive.

When usings SGS do I need to do this, or and I garunteed that when I get a data recieved callback, that I have 1 whole message only on that byte buffer?

Thanks

Endolf

Jeff says

(19:38:05) Jeff: Its doing the framing under the hood
(19:38:13) Jeff: Each callback shoudl be one complete packet
(19:38:17) Jeff: or its my bug.

Sorted :slight_smile:

Btw. We do set tcp no delay in the TCPIP User Manager.

Otherwise nagle will inroduce nasty latencies on small packets.