ZeroMQ接口函數之 :zmq_msg_close – 釋放一個ZMQ消息


ZeroMQ 官方地址 :http://api.zeromq.org/4-2:zmq_msg_close

zmq_msg_close(3)            ØMQ Manual - ØMQ/3.2.5

Name

zmq_msg_close – 釋放一個ZMQ消息

Synopsis

int zmq_msg_close (zmq_msg_t *msg);

Description

zmq_msg_close()函數會通知ZMQ公共結構,所有和參數msg向關聯的資源都不再被需要,並且會被釋放。事實上,釋放與消息對象相關聯的資源會被ZMQ推遲,直到此消息的所有用戶或者數據緩沖區明確指明此消息已經不再被需要為止。

應用程序要確保當一個消息不再被使用的時候應該立刻調用zmq_msg_close()進行資源釋放,否則可能引起內存泄露。

永遠不要直接對zmq_msg_t對象進行直接操作,而是要使用zmq_msg函數族進行操作。

Return value

zmq_msg_close()函數執行成功后會返回0,。否則返回 -1,並且設置errno為下列定義的值。

Errors

  EFAULT

    消息不可用。

See also

zmq_msg_init(3) zmq_msg_init_size(3) zmq_msg_init_data(3) zmq_msg_data(3) zmq_msg_size(3) zmq(7)

Authors

This ØMQ manual page was written by Martin Sustrik <sustrik@250bpm.com> and Martin Lucina <mato@kotelna.sk>.

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

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM