1. 程式人生 > >ZeroMQ介面函式之 :zmq_msg_close – 釋放一個ZMQ訊息

ZeroMQ介面函式之 :zmq_msg_close – 釋放一個ZMQ訊息

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 <

[email protected]> and Martin Lucina <[email protected]>.

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

翻譯:風波

mail : [email protected]