[erlang-questions] Re: Unicast 20k messages, $500-$1000 bounty

Sverker Eriksson <>
Fri Jul 17 12:35:39 CEST 2009


Joel Reymont wrote:
> Since the result of gen_tcp:send is ignored in the broadcasting loop, 
> perhaps erlang:port_command can be used directly on the socket to make 
> things completely asynchronous and avoid the need for a middleman 
> process.
>
> I think solid proof is needed here rather than speciluation.
>
Calling erlang:port_command directly will not make things completely 
asyncronous. The inet driver will suspend the calling process when the 
send queue has reached its high watermark. You will block in 
erlang:port_command until some sending has succeeded and the send queue 
is below a low watermark. Or you can timeout using option send_timeout.

/Sverker, Erlang/OTP



More information about the erlang-questions mailing list