zmq_ctx_term.txt 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. zmq_ctx_term(3)
  2. ===============
  3. NAME
  4. ----
  5. zmq_ctx_term - terminate a 0MQ context
  6. SYNOPSIS
  7. --------
  8. *int zmq_ctx_term (void '*context');*
  9. DESCRIPTION
  10. -----------
  11. The _zmq_ctx_term()_ function shall destroy the 0MQ context 'context'.
  12. Context termination is performed in the following steps:
  13. 1. Any blocking operations currently in progress on sockets open within
  14. 'context' shall return immediately with an error code of ETERM. With the
  15. exception of _zmq_close()_, any further operations on sockets open within
  16. 'context' shall fail with an error code of ETERM.
  17. 2. After interrupting all blocking calls, _zmq_ctx_term()_ shall _block_ until
  18. the following conditions are satisfied:
  19. * All sockets open within 'context' have been closed with _zmq_close()_.
  20. * For each socket within 'context', all messages sent by the application
  21. with _zmq_send()_ have either been physically transferred to a network
  22. peer, or the socket's linger period set with the _ZMQ_LINGER_ socket
  23. option has expired.
  24. For further details regarding socket linger behaviour refer to the _ZMQ_LINGER_
  25. option in linkzmq:zmq_setsockopt[3].
  26. This function replaces the deprecated functions linkzmq:zmq_term[3] and
  27. linkzmq:zmq_ctx_destroy[3].
  28. RETURN VALUE
  29. ------------
  30. The _zmq_ctx_term()_ function shall return zero if successful. Otherwise
  31. it shall return `-1` and set 'errno' to one of the values defined below.
  32. ERRORS
  33. ------
  34. *EFAULT*::
  35. The provided 'context' was invalid.
  36. *EINTR*::
  37. Termination was interrupted by a signal. It can be restarted if needed.
  38. SEE ALSO
  39. --------
  40. linkzmq:zmq[7]
  41. linkzmq:zmq_init[3]
  42. linkzmq:zmq_close[3]
  43. linkzmq:zmq_setsockopt[3]
  44. AUTHORS
  45. -------
  46. This page was written by the 0MQ community. To make a change please
  47. read the 0MQ Contribution Policy at <http://www.zeromq.org/docs:contributing>.