Forum Discussion
On a TCP socket the IP stack can decide to wait and regroup data together before sending the packet. Each stack can have different strategies on how to do that and it seems that in your case the Interniche stacks waits a bit too much for you. I can think of two solutions:[list][*]Set the TCP_NODELAY flag on the socket to tell the stack you don't want it to wait and just to send the packet as soon as you call the send() function[*]Use a UDP socket instead of TCP, which could be more adapted to your situation IMHO. TCP is interesting when you have a continuous stream and don't want any data loss. For a time update message you don't really need the loss detection and retransmission system offered by TCP. It would just make the other end receive the message too late. As you are sending one every second it seems it would be better to either receive the packet immediately, or never receive it if it is lost. There will be a new one one second afterwards anyway.[/list]