TCP based messages

I’m using message for my applaication, I send message over the network looking a bit like RMI.

I’m a bit lazy about implementing error dection and data resend with UDP, I wonder if I can use TCP for send message s.

Precisely how can I force TCP to send the current buffer (my message) and not wait the buffering limit before sending data ?

Disable the ‘Nagle’s algorithm’. Thats TCP-speak for ‘don’t buffer’.
In Java, you use:
Socket.setTcpNoDelay(true);

  • Dom

realize that there are two issues here.

(1) The Nagle packet collection algorithym. its not quite buffering but closely related to it. Crystal squid is right, turn it off.

(2) Java output stream buffering. (Assuming you are using streams.) Always call *.flush() on your stream at the end of writing every packet.

Nice, I’ll test it and say if UDP is useless or no
:stuck_out_tongue: