[erlang-questions] managing the tcp/ip data flow and internal messages

kamiseq kamiseq@REDACTED
Thu Oct 22 19:01:07 CEST 2009

first of all, you can have only one owner process of the socket, so you need
to have one process listening/sending both for socket messages and for
erlang messages. so gen_tcp:receive (as it is blocking) is not enough, and
yes you need to use receive and {active, once}. but now you will face
problems such that you can have many messages from inside of the system that
will result in delayed response to socket clients. and what if your server
get killed then you loose all messages in queue.

you should keep message queue as short as possible.
hope that may help

Paweł Kamiński


More information about the erlang-questions mailing list