From e645fc2693acc796304498909786b7b47005b429 Mon Sep 17 00:00:00 2001 From: Martin Lucina Date: Mon, 23 Jan 2012 08:53:35 +0100 Subject: Imported Upstream version 2.1.3 --- doc/zmq_term.txt | 36 +++++++++++++++++++++--------------- 1 file changed, 21 insertions(+), 15 deletions(-) (limited to 'doc/zmq_term.txt') 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 and +This 0MQ manual page was written by Martin Sustrik and Martin Lucina . -- cgit v1.2.3