HCE Project PHP language client API bindings  1.5.1
Hierarchical Cluster Engine PHP Client Interface API
 All Classes Namespaces Files Functions Variables Pages
zmsg Class Reference

Public Member Functions

 __construct ($socket=null)
 s_encode_uuid ($data)
 s_decode_uuid ($data)
 set_socket (ZMQSocket $socket)
 recv ()
 send ($clear=true)
 parts ()
 last ()
 set_last ($set)
 body ()
 body_set ($body)
 body_fmt ()
 push ($part)
 pop ()
 address ()
 wrap ($address, $delim=null)
 unwrap ()
 __toString ()
 save ($fh)
 load ($fh)

Static Public Member Functions

static test ()

Private Attributes

 $_parts = array()
 $_socket

Detailed Description

Definition at line 33 of file zmsg.php.

Constructor & Destructor Documentation

zmsg::__construct (   $socket = null)

Constructor, accepts optional socket for sending/receiving.

Parameters
ZMQSocket$socket

Definition at line 54 of file zmsg.php.

Member Function Documentation

zmsg::__toString ( )

Dump the contents to a string, for debugging and tracing.

Returns
string

Definition at line 293 of file zmsg.php.

Here is the call graph for this function:

zmsg::address ( )

Return the address of the message

Returns
void
Author
Ian Barber

Definition at line 243 of file zmsg.php.

Here is the call graph for this function:

Here is the caller graph for this function:

zmsg::body ( )

Return the body

Returns
string

Definition at line 180 of file zmsg.php.

zmsg::body_fmt ( )

Set message body using printf format

Returns
void

Definition at line 207 of file zmsg.php.

Here is the call graph for this function:

zmsg::body_set (   $body)

Set message body to provided string.

Parameters
string$body
Returns
Zmsg

Definition at line 191 of file zmsg.php.

Here is the caller graph for this function:

zmsg::last ( )

Return the last part of the message

Returns
string

Definition at line 160 of file zmsg.php.

zmsg::load (   $fh)

Load a message saved with the save function

Parameters
filehandle$fh
Returns
this

Definition at line 407 of file zmsg.php.

zmsg::parts ( )

Report size of message

Returns
int

Definition at line 150 of file zmsg.php.

zmsg::pop ( )

Pop message part off front of message parts

Returns
string
Author
Ian Barber

Definition at line 232 of file zmsg.php.

Here is the caller graph for this function:

zmsg::push (   $part)

Push message part to front

Parameters
string$part
Returns
void

Definition at line 221 of file zmsg.php.

Here is the caller graph for this function:

zmsg::recv ( )

Receive message from socket Creates a new message and returns it Blocks on recv if socket is not ready for input

Exceptions
Exceptionif no socket present
Returns
Zmsg

Definition at line 103 of file zmsg.php.

zmsg::s_decode_uuid (   $data)

Format the hex string back into a packed int.

Parameters
string$data
Returns
string

Definition at line 77 of file zmsg.php.

Here is the caller graph for this function:

zmsg::s_encode_uuid (   $data)

Formats 17-byte UUID as 33-char string starting with '@' Lets us print UUIDs as C strings and use them as addresses

Parameters
string$data
Returns
string

Definition at line 66 of file zmsg.php.

Here is the caller graph for this function:

zmsg::save (   $fh)

Save a msg to a file

Parameters
filehandle$fh
Returns
this

Definition at line 389 of file zmsg.php.

zmsg::send (   $clear = true)

Send message to socket. Destroys message after sending.

Exceptions
Exceptionif no socket present
Parameters
boolean$clear
Returns
Zmsg

Definition at line 126 of file zmsg.php.

zmsg::set_last (   $set)

Set the last part of the message

Parameters
string$set

Definition at line 170 of file zmsg.php.

zmsg::set_socket ( ZMQSocket  $socket)

Set the internal socket to use for sending or receiving.

Parameters
ZMQSocket$socket
Returns
Zmsg

Definition at line 88 of file zmsg.php.

static zmsg::test ( )
static

Run a self test of the Zmsg class.

Returns
boolean
Todo:
See if assert returns

Definition at line 314 of file zmsg.php.

zmsg::unwrap ( )

Unwraps outer message envelope and returns address Discards empty message part after address, if any

Returns
void
Author
Ian Barber

Definition at line 278 of file zmsg.php.

Here is the call graph for this function:

zmsg::wrap (   $address,
  $delim = null 
)

Wraps message in new address envelope. If delim is not null, creates two part envelope.

Parameters
string$address
string$delim
Returns
void

Definition at line 258 of file zmsg.php.

Here is the call graph for this function:

Member Data Documentation

zmsg::$_parts = array()
private

Definition at line 40 of file zmsg.php.

zmsg::$_socket
private

Definition at line 47 of file zmsg.php.


The documentation for this class was generated from the following file: