Re: [Exim] Using TCP_NODELAY?

Góra strony
Delete this message
Reply to this message
Autor: michael
Data:  
Dla: exim-users
Temat: Re: [Exim] Using TCP_NODELAY?
> It would save me some research if you summarized what TCP_NODELAY
> actually does, or referenced a man page.


       TCP_NODELAY
              Turn the Nagle algorithm off. This means that pack-
              ets are always sent as  soon  as  possible  and  no
              unnecessary  delays  are introduced, at the cost of
              more packets in the  network.  Expects  an  integer
              boolean flag.


The cost of more packets arises in two situations: A program does not
buffer and uses more write()s than needed and a program does not know
in advance if more data needs to be sent, like telnet now knowing if
the user continues to type fast.

Exim does its own buffering, so using the above option should only reduce
latency without generating more packets. The option is used like this:

#include <netinet/tcp.h>

int one=1;
setsockopt(sock,SOL_TCP,TCP_NODELAY,&one,sizeof(one));

Michael