Open wangzhenandy opened 7 years ago
exit(SupPid, normal) but SupPid(coap_channel_sup) can not exit because
If Reason is the atom normal, Pid does not exit. If it is trapping exits, the exit signal is transformed into a message {'EXIT', From, normal} and delivered to its message queue.
so why use exit(SupPid, normal), it not work exit(SupPid, kill) and coap_channel_sup_sup:delete_channel(PoolPid, ChId) can make SupPid shutdown is that right?
Hello,
I Found the processes of
coap_channel_sup
andcoap_responder_sup
can't be closed after coap request socket closed.I test it like:
coap_channel_sup
,coap_channel
,coap_responder_sup
,coap_responder
;coap_responder
was closed first after finished the request;coap_channel
was closed when the client ack timeout;coap_channel_sup
andcoap_responder_sup
could't closed;The code in file coap_udp_socker.erl is like: handle_info({terminated, SupPid, ChId}, State=#state{chans=Chans}) -> Chans2 = dict:erase(ChId, Chans), exit(SupPid, normal), {noreply, State#state{chans=Chans2}};
is it right to change it like this? handle_info({terminated, SupPid, ChId}, State=#state{chans=Chans, pool=PoolPid}) -> Chans2 = dict:erase(ChId, Chans), exit(SupPid, normal), coap_channel_sup_sup:delete_channel(PoolPid, ChId), {noreply, State#state{chans=Chans2}};