Commit ea9f7acc authored by Pieter Hintjens's avatar Pieter Hintjens

Problem: zmq_ctx_term has insane behavior by default

Solution: document this with a clear warning. It would be
nicer perhaps to change the default LINGER to e.g. a few
seconds. However this could break existing applications.
parent be55c5ac
...@@ -23,8 +23,8 @@ Context termination is performed in the following steps: ...@@ -23,8 +23,8 @@ Context termination is performed in the following steps:
exception of _zmq_close()_, any further operations on sockets open within exception of _zmq_close()_, any further operations on sockets open within
'context' shall fail with an error code of ETERM. 'context' shall fail with an error code of ETERM.
2. After interrupting all blocking calls, _zmq_ctx_term()_ shall _block_ until the 2. After interrupting all blocking calls, _zmq_ctx_term()_ shall _block_ until
following conditions are satisfied: the following conditions are satisfied:
* All sockets open within 'context' have been closed with _zmq_close()_. * All sockets open within 'context' have been closed with _zmq_close()_.
...@@ -39,6 +39,15 @@ option in linkzmq:zmq_setsockopt[3]. ...@@ -39,6 +39,15 @@ option in linkzmq:zmq_setsockopt[3].
This function replaces the deprecated function linkzmq:zmq_term[3]. This function replaces the deprecated function linkzmq:zmq_term[3].
WARNING
-------
As _ZMQ_LINGER_ defaults to "infinite", by default this function will block
indefinitely if there are any pending connects or sends. We strongly
recommend to (a) set _ZMQ_LINGER_ to zero on all sockets and (b) close all
sockets, before calling this function.
RETURN VALUE RETURN VALUE
------------ ------------
The _zmq_ctx_term()_ function shall return zero if successful. Otherwise The _zmq_ctx_term()_ function shall return zero if successful. Otherwise
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment