ZeroMQ 官方地址 :http://api.zeromq.org/4-0:zmq_ctx_destroy
zmq_ctx_destroy(3) ØMQ Manual - ØMQ/3.2.5
Name
zmq_ctx_destroy - 銷毀一個ZMQ環境上下文(context)
Synopsis
int zmq_ctx_destroy (void *context);
Description
zmq_ctx_destroy()函數會銷毀ZMQ環境上下文context
環境上下文將會以下面的步驟進行終結:
● 在當前進程中,所有基於context創建的socket,若在執行阻塞操作,則會立即返回並返回錯誤代碼ETERM。除了zmq_close()函數之外,所有在基於context創建的socket上的更深層次的操作都會失敗,並返回錯誤代碼ETERM。
● 在中斷所有的阻塞調用后,zmq_ctx_destroy()將會阻塞,直到滿足以下情況:<itemizedlist> <listitem> 所有基於context創建的socket都已經被zmq_close()關閉。
● 對於基於context創建的每一個socket,所有被應用程序調用zmq_send() 發送的消息都已經被真實的發送到了網絡上,或者用ZMQ_LINGER參數設置的socket的執行周期已經期滿。
更多關於socket linger的行為請參見zmq_setsockopt(3)函數的ZMQ_LINGER選項。
這個函數已經取代了已經不被贊成使用的函數zmq_term(3)。
Return value
執行成功時zmq_ctx_destroy()返回0.其它情況返回 -1,並且設置errno為下列值。
Errors
EFAULT
提供的context參數不可用。
EINTR
被系統信號中斷了。如果需要可以進行重啟。
See also
zmq(7) zmq_init(3) zmq_close(3) zmq_setsockopt(3)
Authors
This ØMQ manual page was written by Pieter Hintjens <ph@imatix.com>
Web site design and content is copyright (c) 2007-2012 iMatix Corporation. Contact us for professional support. Site content licensed under the Creative Commons Attribution-Share Alike 3.0 License. ØMQ is copyright (c) Copyright (c) 2007-2012 iMatix Corporation and Contributors. ØMQ is free software licensed under the LGPL. ØMQ, ZeroMQ, and 0MQ are trademarks of iMatix Corporation. Terms of Use — Privacy
Policy
更多 ZeroMQ API :http://www.cnblogs.com/fengbohello/p/4230135.html
翻譯:風波
mail : fengbohello@qq.com