gen_server can't trap 'EXIT' from parent

Vlad Dumitrescu vlad_dumitrescu@REDACTED
Tue Jan 11 10:58:12 CET 2005


----- Original Message ----- 
From: "Fredrik Thulin" <ft@REDACTED>
> > Your gen_server gets notified that the parent creshed: terminate is
> > called. You can do whatever you need to do there, instead of inside
> > handle_info. It's just the same, since the gen_server should probably
> > exit too.
>
> No it shouldn't. My gen_server should send a SIP error message back, and
> then stay alive for (most oftenly) 32 seconds to make sure that we
> re-send this SIP error message if we get a resend of the original SIP
> request (not my idea to run SIP over unreliable transports...).

Jaha, okay, I understand. Then I think the process that starts this gen_server
shouldn't be its parent (in the regular meaning where the parent is a
supervisor), and then the solution you came up with (i.e. linking from inside
init instead of using start_link) is right.

regards,
Vlad



More information about the erlang-questions mailing list