> I have built two applications which communicate through TCP/IP. Each one
> sends very small packets of data to the other one and waits for an answer.
> When one writes a packet of data to the socket, how do we tell the socket
> that no other data will follow and that it should immediatly sent the
> small packet ?

Synapse sending data through socket interface soon as possible. But what 
doing socket layer inside your operating system, it is out of your 
control. (yes, you can control it, in some cases...)

In case of UDP, packets are sended ASAP.

In case of TCP network stack usually using some optimalizations, what can 
delay sending of some packet, but porpose of these optimalizations is 
better performance. (In case of TCP are not sended just data packets, but 
are sended lot of control packets too, and this can be optimalized for 
better performance.)

In most cases you can just send data and forgot what happen on wires. 
Default options are best for most cases. Especially in scenario request-
response (send-receive-send-receive).

In case of scenario send-send-send... some sending packets can be delayed 
by NAGLE optimalization. But this is optimalization what increasing 
performance in most cases. Do not disable it (you can do this...) if you 
not have very good reason for this!

In case of send-send-receive (with small data packets) scenario you can 
got cca 200ms delay by delayed ACK optimalization. Best will be avoid 
this scenario by merging two or more subsequent small send operations to 
one common send operation.

All these scenarios are for TCP only! UDP is not affected by this.


--
Lukas Gebauer.

E-mail: [EMAIL PROTECTED]
WEB: http://www.ararat.cz/synapse - Synapse Delphi and Kylix TCP/IP 
Library



-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
synalist-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/synalist-public

Reply via email to