[erlang-questions] tcp sockets - not clear
Sun Oct 5 19:55:29 CEST 2008
Unless you write it otherwise, I would imagine that each front-end object
will get its own independent socket and therefore have its own channel to
the back end. On the back end, have a listener that kicks off one Erlang
process per new socket to handle the message. Messages in this way will not
interfere with each other and you can construct them without fear of them
getting mixed up.
If you want to see a good example of this, look at the way the listener in
the gen_smsc.erl module of the OSERL application (
http://oserl.sourceforge.net) waits for connections, spawns a session
process for each connection, and passes off the now-open socket to the
spawned process (and makes it the owner of the socket, too - important).
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the erlang-questions