ZeroMQ::Message(3pm)

ZeroMQ::Message3pm

A 0mq message object

Usage

  use ZeroMQ qw/:all/;
  
  my $cxt = ZeroMQ::Context->new;
  my $sock = ZeroMQ::Socket->new($cxt, ZMQ_REP);
  my $msg = ZeroMQ::Message->new($text);
  $sock->send($msg);
  my $anothermsg = $sock->recv;

Overview

A "ZeroMQ::Message" object represents a message to be passed over a "ZeroMQ::Socket".

Methods

new

Creates a new "ZeroMQ::Message".

Takes the data to send with the message as argument.

new_from_message( $rawmsg )

Creates a new "ZeroMQ::Message".

Takes a ZeroMQ::Raw::Message object as argument.

message

Return the underlying ZeroMQ::Raw::Message object.

size

Returns the length (in bytes) of the contained data.

data

Returns the data as a (potentially binary) string.