chumak icon indicating copy to clipboard operation
chumak copied to clipboard

when another side exited, implementations should handle it

Open DavidAlphaFox opened this issue 6 years ago • 0 comments

In server mode chumak_socket should not exit when a peer shutdown except pair mode. I think this should be handled in implementation of each patterns, every implementation should decide exit or not. So the implementations should add another argument in peer_disconected to handle the reason of exit. But I found a lot of shutdown tuples in chumak_peer and the code of below in chumak_socket

 handle_info({'EXIT', PeerPid, {shutdown, _Reason}}, State) ->
    exit_peer(PeerPid, State),
   {stop, normal, State};

My question is that there is any intended to use shutdown as a special operation to stop chumak_socket ?

DavidAlphaFox avatar Jan 16 '18 06:01 DavidAlphaFox