[erlang-questions] gen_tcp send non-blocking in erlang?

Max Lapshin <>
Mon Mar 17 09:53:41 CET 2014


It is a very, very dangerous practice, because you loose control over your
program with non-blocking send.

First step that you MUST do is setting send_timeout on socket. By default
it is infinity and it means that your process may get blocked forever
trying to push data.

I don't know why infinity is a default value, it is really strange for me.

Second, dangerous step is just using port_command(Socket, IoData). Then you
must wait for messages from this socket. But don't use it =)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20140317/4061e867/attachment.html>


More information about the erlang-questions mailing list