Yes, you just need to make sure the socket<br>is opened in active mode, or set it to active after<br><br>inet:setopts(Socket, [{active, once}]),<br><br><div class="gmail_quote">2009/4/2 Gamoto <span dir="ltr"><gamoto@bluewin.ch></span><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Is this possible for one process to receive messages from two sources whose one of these is a socket ?<br>
<br>
Example<br>
<br>
my_process(Socket)-><br>
receive<br>
{tcp,Socket,Bin}-> %equivalent to gen_tcp:recv(Socket,0) ????<br>
... %handle Bin<br>
my_process(Socket); %loop<br>
{msg,Message} -> %from another process<br>
... %handle Message i.e gen_send(Socket,Message)<br>
my_process(Socket); %loop<br>
end.<br>
<br>
_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
<a href="http://www.erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://www.erlang.org/mailman/listinfo/erlang-questions</a><br>
</blockquote></div><br>