Zeromq interface function: Zmq_msg_init_data-Initializes a ZMQ message object's data from a specified storage space

Source: Internet
Author: User
Tags creative commons attribution

ZeroMQ official address:http://api.zeromq.org/4-1:zmq_msg_init_data

Zmq_msg_init_data (3) ØMQ Manual-ømq/3.2.5

Name

Zmq_msg_init_data-initializes the data for a ZMQ Message Object from a specified storage space

Synopsis

void (ZMQ_FREE_FN) (voidvoid *hint); int void *data, size_t size, ZMQ_FREE_FN *ffn,void *hint);

Description

zmq_msg_init_data () parameters and size msg specified by the parameter. zmq zmq No copy operation is performed and zmq Get ownership of the specified data.

ffn , ffn will be in the Span style= "font-family: ' Times New Roman ';" >data zmq call once, zmq Span style= "font-family: the song Body;" > will zmq_msg_init_data () data and hint ffn function.

You should never directly manipulate the zmq_msg_t object directly, but instead use the zmq_msg function family to do so.

The three functions of Zmq_msg_init (),zmq_msg_init_data () , and zmq_msg_init_size () are mutually exclusive. Never initialize a zmq_msg_t object two of times.

Return value

A successful execution of function zmq_msg_init_data () returns 0. Otherwise , 1is returned, and the value of errno is set to the value specified below.

Errors

 Enomem

There is not enough storage space.

Example

  Initializes the ZMQ message object with a specified storage space .

 void  *data, hint) {free (data);}  /*   ...  */ void  *data = malloc (6    abcdef  , 6   ); zmq_msg_t MSG;RC  = Zmq_msg_init_data (&msg, data, 6 , My_free, NULL); ASSERT (rc = = 0 ); 

See Also

Zmq_msg_init_size (3) zmq_msg_init (3) zmq_msg_close (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

more ZeroMQ API :http://www.cnblogs.com/fengbohello/p/4230135.html

Translation: The Storm

Mail: [Email protected]

Zeromq interface function: Zmq_msg_init_data-Initializes a ZMQ message object's data from a specified storage space

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.