zeromq / chumak

Pure Erlang implementation of ZeroMQ Message Transport Protocol.
Mozilla Public License 2.0
197 stars 47 forks source link

Added socket process stop after receiving exit signal #19

Closed Prots closed 6 years ago

drozzy commented 6 years ago

Fixes #18.

nifoc commented 6 years ago

Sorry for posting in an old PR, but I think I've narrowed a problem I'm having down to this PR.

If I understand the changes correctly, the chumak_socket:handle_info({'EXIT'... function will be called every time a peer disconnects, which will now always cause the socket process to be stopped.

So even if you have multiple peers, the entire socket will be closed as soon as one peer disconnects. Is that really the intended behaviour?

drozzy commented 6 years ago

@nifoc Seems like you have a point.

Do you have any suggestions on how to fix it?

(The erlang process behavior is not actually mandated by zmtp protocol, so any ideas are welcome!)