[erlang-questions] Erlang supervisor start_child

Alexander Kuleshov kuleshovmail@REDACTED
Sun Jan 30 17:30:38 CET 2011


On Sun, Jan 30, 2011 at 4:13 PM, Alexey Romanov
<alexey.v.romanov@REDACTED> wrote:
> Yours, Alexey Romanov
>
>
>
> On Sun, Jan 30, 2011 at 7:05 PM, Alexander Kuleshov
> <kuleshovmail@REDACTED> wrote:
>>>Since you can't have two processes with same registered name on a
>>>node, you need to provide different names (or no names at all).
>>
>> Hello,
>>
>> If i havent gen_fsm name, how can i gen_fsm:send_event to this gen_fsm?
>>
>
> By the pid (which you can get from supervisor:which_children).
>

Thank you for reply.

In popd_listener i try:

pop_fsm_sup:start_child(Sock, [], []),
[{_,_, Child, _}] = supervisor:which_children(pop_fsm_sup),

When i connect with first client it's ok, but when i try to connect
with second client i see error:

Error in process <0.815.0> on node 'emacs@REDACTED' with exit value:
{{badmatch,[{undefined,<0.818.0>,worker,[popd_fsm]},{undefined,<0.819.0>,worker,[popd_fsm]}]},[{popd_listener,accept,1}]}


More information about the erlang-questions mailing list