alphacomm / alpharpc

AlphaRPC is an RPC daemon based on ZeroMQ that can be used to distribute workload over one or multiple servers.
alpharpc.net
BSD 3-Clause "New" or "Revised" License
2 stars 5 forks source link

Worker does not stop when Worker Handler is unavailable. #15

Closed jacobkiers closed 10 years ago

jacobkiers commented 10 years ago

I started a worker for which the Worker Handler was not available. Therefore, after a couple of seconds I expected the worker to kill itself. Instead it kept running, but did nothing.

jacobkiers commented 10 years ago

The issue was that ZMQ::SOCKOPT_LINGER was not disabled (it is enabled by default). That setting tells ZeroMQ that it should wait with closing the socket until all messages are sent and/or received.

The attached pull request makes sure that this option is disabled by default. When you want a socket to linger, you can do so by explicitly adding that option when creating the Factory or the Socket.