summaryrefslogtreecommitdiff
path: root/doc/zmq_term.txt
diff options
context:
space:
mode:
authorMartin Lucina <martin@lucina.net>2012-01-23 08:53:35 +0100
committerMartin Lucina <martin@lucina.net>2012-01-23 08:53:35 +0100
commite645fc2693acc796304498909786b7b47005b429 (patch)
tree4118cd4c7b9eba3ba1d6892800c79669ea94c4e9 /doc/zmq_term.txt
parent2c416a793ea781273a5da6742211f5f01af13a2b (diff)
Imported Upstream version 2.1.3upstream/2.1.3
Diffstat (limited to 'doc/zmq_term.txt')
-rw-r--r--doc/zmq_term.txt36
1 files changed, 21 insertions, 15 deletions
diff --git a/doc/zmq_term.txt b/doc/zmq_term.txt
index f3ffa01..c7e13d7 100644
--- a/doc/zmq_term.txt
+++ b/doc/zmq_term.txt
@@ -14,25 +14,27 @@ SYNOPSIS
DESCRIPTION
-----------
-The _zmq_term()_ function terminates the 0MQ context 'context'.
+The _zmq_term()_ function shall terminate the 0MQ context 'context'.
-If there are no longer any sockets open within 'context' at the time
-_zmq_term()_ is called then 'context' shall be shut down and all associated
-resources shall be released immediately.
+Context termination is performed in the following steps:
-Otherwise, the following applies:
+1. Any blocking operations currently in progress on sockets open within
+ 'context' shall return immediately with an error code of ETERM. With the
+ exception of _zmq_close()_, any further operations on sockets open within
+ 'context' shall fail with an error code of ETERM.
-* The _zmq_term()_ function shall return immediately.
+2. After interrupting all blocking calls, _zmq_term()_ shall _block_ until the
+ following conditions are satisfied:
++
+ * All sockets open within 'context' have been closed with _zmq_close()_.
-* Any blocking operations currently in progress on sockets open within
- 'context' shall return immediately with an error code of ETERM.
+ * For each socket within 'context', all messages sent by the application
+ with _zmq_send()_ have either been physically transferred to a network
+ peer, or the socket's linger period set with the _ZMQ_LINGER_ socket
+ option has expired.
-* With the exception of _zmq_close()_, any further operations on sockets open
- within 'context' shall fail with an error code of ETERM.
-
-* The actual shutdown of 'context', and release of any associated resources,
- *shall be delayed* until the last socket within it is closed with
- _zmq_close()_.
+For further details regarding socket linger behaviour refer to the _ZMQ_LINGER_
+option in linkzmq:zmq_setsockopt[3].
RETURN VALUE
@@ -45,15 +47,19 @@ ERRORS
------
*EFAULT*::
The provided 'context' was not valid (NULL).
+*EINTR*::
+Termination was interrupted by a signal. It can be restarted if needed.
SEE ALSO
--------
linkzmq:zmq[7]
linkzmq:zmq_init[3]
+linkzmq:zmq_close[3]
+linkzmq:zmq_setsockopt[3]
AUTHORS
-------
-The 0MQ documentation was written by Martin Sustrik <sustrik@250bpm.com> and
+This 0MQ manual page was written by Martin Sustrik <sustrik@250bpm.com> and
Martin Lucina <mato@kotelna.sk>.