Qore zmq Module
1.0.0
|
The ZMsg class implements a ZeroMQ message. More...
Public Member Methods | |
nothing | add (Qore::ZMQ::ZFrame frame) |
Pushes a frame to the end of the message; the frame is consumed by this call. More... | |
nothing | add (string str) |
Adds a string as a block of memory to the end of the message as a new frame. More... | |
nothing | add (binary bin) |
Adds a binary object to the end of the message as a new frame. More... | |
nothing | add (Qore::ZMQ::ZMsg submsg) |
Adds a message to the end of the message as a submessage; the message argument is consumed by this call. More... | |
constructor (...) | |
constructs a ZMsg from the arguments supplied More... | |
constructor (list l) | |
constructs a ZMsg from the list of arguments supplied More... | |
int | contentSize () |
Returns the byte size of all frames in the message. More... | |
copy () | |
copies a ZMsg object More... | |
ZFrame | encode () |
Serializes a multipart message to a single message frame. More... | |
bool | eq (ZMsg msg2) |
Returns True if two msgs have identical size and data. More... | |
*string | meta (string property) |
Returns meta data property for the first frame in the message. More... | |
*binary | popBin (*string encoding) |
Pops the first frame off the front of message and returns it as a binary value. More... | |
*ZFrame | popFrame () |
Removes and returns the first frame from the message, if any. More... | |
*ZMsg | popMsg () |
Removes and returns the first submessage from message, if any. More... | |
*string | popStr (*string encoding) |
Pops the first frame off the front of message and returns it as a string. More... | |
nothing | print () |
Sends a message to the zsys log sink (may be stdout, or system facility) More... | |
nothing | push (string str) |
Pushes a string as a block of memory to the beginning of the message as a new frame. More... | |
nothing | push (binary bin) |
Pushes a block of memory to the beginning of the message as a new frame. More... | |
nothing | push (Qore::ZMQ::ZFrame frame) |
Pushes a frame to the beginning of the message, i.e. before all other frames; the frame is consumed by this call. More... | |
int | routingId () |
Returns a routing ID greater than 0 if the message is from a SERVER socket, 0 if not. More... | |
nothing | save (Qore::File file) |
Saves the message contents to an open file. More... | |
nothing | setRoutingId (int routing_id) |
Sets a routing ID on the message for use with SERVER sockets. More... | |
int | signal () |
Returns the signal value, 0 or greater, if message is a signal, -1 if not. More... | |
int | size () |
Returns the number of frames in the message. More... | |
The ZMsg class implements a ZeroMQ message.
ZMSG-THREAD-ERROR
to be thrown. nothing Qore::ZMQ::ZMsg::add | ( | Qore::ZMQ::ZFrame | frame | ) |
Pushes a frame to the end of the message; the frame is consumed by this call.
frame | the frame to add to the end of the message; the argument object will be deleted by this call |
ZMSG-APPEND-ERROR | this exception is thrown if any error occurs adding the frame to the message |
ZMSG-THREAD-ERROR | this exception is thrown when the object is used in a thread other than the one that created it |
nothing Qore::ZMQ::ZMsg::add | ( | string | str | ) |
Adds a string as a block of memory to the end of the message as a new frame.
str | the string to add to the end of the message |
ZMSG-ADD-ERROR | this exception is thrown if any error occurs adding the frame to the message |
ZMSG-THREAD-ERROR | this exception is thrown when the object is used in a thread other than the one that created it |
nothing Qore::ZMQ::ZMsg::add | ( | binary | bin | ) |
Adds a binary object to the end of the message as a new frame.
bin | the binary object to add to the end of the message |
ZMSG-ADD-ERROR | this exception is thrown if any error occurs adding the frame to the message |
ZMSG-THREAD-ERROR | this exception is thrown when the object is used in a thread other than the one that created it |
nothing Qore::ZMQ::ZMsg::add | ( | Qore::ZMQ::ZMsg | submsg | ) |
Adds a message to the end of the message as a submessage; the message argument is consumed by this call.
submsg | the submessage to add to the end of the message; this object is deleted by this call |
ZMSG-ADD-ERROR | this exception is thrown if any error occurs adding the submessage to the message |
ZMSG-THREAD-ERROR | this exception is thrown when the object is used in a thread other than the one that created it |
Qore::ZMQ::ZMsg::constructor | ( | ... | ) |
constructs a ZMsg from the arguments supplied
... | zero or more values to add to the message as frames; values are processed as follows: |
ZMSG-ERROR | unsupported data type passed as an argument |
Qore::ZMQ::ZMsg::constructor | ( | list | l | ) |
constructs a ZMsg from the list of arguments supplied
l | zero or more values to add to the message as frames; values are processed as follows: |
ZMSG-ERROR | unsupported data type passed as an argument |
int Qore::ZMQ::ZMsg::contentSize | ( | ) |
Returns the byte size of all frames in the message.
ZMSG-THREAD-ERROR | this exception is thrown when the object is used in a thread other than the one that created it |
Qore::ZMQ::ZMsg::copy | ( | ) |
copies a ZMsg object
ZMSG-THREAD-ERROR | this exception is thrown when the object is used in a thread other than the one that created it |
ZFrame Qore::ZMQ::ZMsg::encode | ( | ) |
Serializes a multipart message to a single message frame.
Use this method to send structured messages across transports that do not support multipart data. Creates a new ZFrame object containing the serialized message.
ZMSG-THREAD-ERROR | this exception is thrown when the object is used in a thread other than the one that created it |
bool Qore::ZMQ::ZMsg::eq | ( | ZMsg | msg2 | ) |
Returns True if two msgs have identical size and data.
msg2 | the message to compare |
ZMSG-THREAD-ERROR | this exception is thrown when the object is used in a thread other than the one that created it |
*string Qore::ZMQ::ZMsg::meta | ( | string | property | ) |
Returns meta data property for the first frame in the message.
property | a meta-data property for the first frame in the message; the string is converted to UTF-8 encoding if necessary; the following properties are available:
|
MISSING-FEATURE-ERROR | thrown if the underlying czmq library is missing the zframe_meta() function; check HAVE_ZFRAME_META before calling this method |
ENCODING-CONVERSION-ERROR | this exception could be thrown if an encoding error is encountered when converting the given string to UTF-8 |
*binary Qore::ZMQ::ZMsg::popBin | ( | *string | encoding | ) |
Pops the first frame off the front of message and returns it as a binary value.
ZMSG-THREAD-ERROR | this exception is thrown when the object is used in a thread other than the one that created it |
*ZFrame Qore::ZMQ::ZMsg::popFrame | ( | ) |
Removes and returns the first frame from the message, if any.
ZMSG-THREAD-ERROR | this exception is thrown when the object is used in a thread other than the one that created it |
*ZMsg Qore::ZMQ::ZMsg::popMsg | ( | ) |
Removes and returns the first submessage from message, if any.
ZMSG-THREAD-ERROR | this exception is thrown when the object is used in a thread other than the one that created it |
*string Qore::ZMQ::ZMsg::popStr | ( | *string | encoding | ) |
Pops the first frame off the front of message and returns it as a string.
encoding | the character encoding tag for the string return value; if not present, the default character encoding is assumed. |
ZMSG-THREAD-ERROR | this exception is thrown when the object is used in a thread other than the one that created it |
nothing Qore::ZMQ::ZMsg::print | ( | ) |
Sends a message to the zsys log sink (may be stdout, or system facility)
ZMSG-THREAD-ERROR | this exception is thrown when the object is used in a thread other than the one that created it |
nothing Qore::ZMQ::ZMsg::push | ( | string | str | ) |
Pushes a string as a block of memory to the beginning of the message as a new frame.
the | string to add to the beginning of the message |
ZMSG-PUSH-ERROR | this exception is thrown if any error occurs adding the frame to the message |
ZMSG-THREAD-ERROR | this exception is thrown when the object is used in a thread other than the one that created it |
nothing Qore::ZMQ::ZMsg::push | ( | binary | bin | ) |
Pushes a block of memory to the beginning of the message as a new frame.
the | string to add to the beginning of the message |
ZMSG-PUSH-ERROR | this exception is thrown if any error occurs adding the frame to the message |
ZMSG-THREAD-ERROR | this exception is thrown when the object is used in a thread other than the one that created it |
nothing Qore::ZMQ::ZMsg::push | ( | Qore::ZMQ::ZFrame | frame | ) |
Pushes a frame to the beginning of the message, i.e. before all other frames; the frame is consumed by this call.
frame | the frame to add to the beginning of the message; the argument object will be deleted by this call |
ZMSG-PREPEND-ERROR | this exception is thrown if any error occurs prepending the frame to the message |
ZMSG-THREAD-ERROR | this exception is thrown when the object is used in a thread other than the one that created it |
int Qore::ZMQ::ZMsg::routingId | ( | ) |
Returns a routing ID greater than 0 if the message is from a SERVER
socket, 0 if not.
SERVER
socket, 0 if notMISSING-FEATURE-ERROR | thrown if the underlying czmq library is missing draft APIs; check HAVE_ZMQ_DRAFT_APIS before calling this method |
nothing Qore::ZMQ::ZMsg::save | ( | Qore::File | file | ) |
Saves the message contents to an open file.
file | the file to save the data to; must be open for writing |
The message is saved as a series of frames, each with length and data.
ZMSG-THREAD-ERROR | this exception is thrown when the object is used in a thread other than the one that created it |
ZMSG-SAVE-ERROR | if there is any error saving the data, this exception is thrown |
nothing Qore::ZMQ::ZMsg::setRoutingId | ( | int | routing_id | ) |
Sets a routing ID on the message for use with SERVER
sockets.
routing_id | a routing ID for the message |
MISSING-FEATURE-ERROR | thrown if the underlying czmq library is missing draft APIs; check HAVE_ZMQ_DRAFT_APIS before calling this method |
int Qore::ZMQ::ZMsg::signal | ( | ) |
Returns the signal value, 0 or greater, if message is a signal, -1 if not.
ZMSG-THREAD-ERROR | this exception is thrown when the object is used in a thread other than the one that created it |
int Qore::ZMQ::ZMsg::size | ( | ) |
Returns the number of frames in the message.
ZMSG-THREAD-ERROR | this exception is thrown when the object is used in a thread other than the one that created it |