set TCP PUSH option on socket?

Gaspar Chilingarov <>
Thu Jan 27 15:17:38 CET 2005


Matthias Lang wrote:
> Gaspar Chilingarov writes:
> 
>  > are there any way to set PUSH option on socket ?
>  > it's needed in telnet-like applications to get bytes 
>  > as they typed by user
> 
> I'm not sure what the "PUSH option" is.
> 
> Maybe you mean TCP_NODELAY, which Erlang maps to {nodelay,
> Boolean}. Maybe you missed this option when you were carefully reading
> the man pages, or maybe there really is some PUSH option I don't know
> about.
> 
> See also:
> 
>   http://www.erlang.se/doc/doc-5.4.3/lib/kernel-2.10.3/doc/html/inet.html
>   http://www.erlang.se/doc/doc-5.4.3/lib/kernel-2.10.3/doc/html/gen_tcp.html
> 
> Matthias
> 


there is PUSH option in tcp which forces OS write packet to network as 
fast as possible after user called write function -- this is not the 
same as TCP_NODELAY -- which ... well , this is a quote from RFC :)

   A sending TCP is allowed to collect data from the sending user and to
   send that data in segments at its own convenience, until the push
   function is signaled, then it must send all unsent data.  When a
   receiving TCP sees the PUSH flag, it must not wait for more data from
   the sending TCP before passing the data to the receiving process.

so, it effectively disables any os buffering of packets -- which is very 
well suited for telnet applications -- every symbol typed by user goes 
to server in separate packet(or several chars it you type very fast, btw ;).

it seems that TCP_PUSH not implemented in Erlang options.



More information about the erlang-questions mailing list