The Stomp client interacts with a Stomp server.

category Zend
package Zend_Queue
subpackage Stomp
copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
license New BSD License

 Methods

Close the socket explicitly when destructed

__destruct() : void

Tests the socket to see if there is data for us

canRead() : boolean
inherited_from \Zend_Queue_Stomp_Client_ConnectionInterface::canRead()

Returns

boolean

Close connection

close(boolean $destructor = false) : void
inherited_from \Zend_Queue_Stomp_Client_ConnectionInterface::close()

Parameters

$destructor

boolean

Create an empty frame

createFrame() : \Zend_Queue_Stomp_FrameInterface
inherited_from \Zend_Queue_Stomp_Client_ConnectionInterface::createFrame()

Returns

\Zend_Queue_Stomp_FrameInterface

Get the frameClass

getFrameClass() : string
inherited_from \Zend_Queue_Stomp_Client_ConnectionInterface::getFrameClass()

Returns

string

open() opens a socket to the Stomp server

open(string $scheme, string $host, integer $port, array $options = array()) : \true;
inherited_from \Zend_Queue_Stomp_Client_ConnectionInterface::open()

Parameters

$scheme

string

$host

string

$port

integer

$options

arrayarray

('scheme', 'host', 'port')

Exceptions

\Zend_Queue_Exception

Returns

\true;

Check whether we are connected to the server

ping() : true
inherited_from \Zend_Queue_Stomp_Client_ConnectionInterface::ping()

Exceptions

\Zend_Queue_Exception

Returns

true

Reads in a frame from the socket or returns false.

read() : \Zend_Queue_Stomp_FrameInterface | false
inherited_from \Zend_Queue_Stomp_Client_ConnectionInterface::read()

Exceptions

\Zend_Queue_Exception

Returns

\Zend_Queue_Stomp_FrameInterfacefalse

Set the frameClass to be used

setFrameClass(string $classname) : \$this;

This must be a Zend_Queue_Stomp_FrameInterface.

inherited_from \Zend_Queue_Stomp_Client_ConnectionInterface::setFrameClass()

Parameters

$classname

string
  • class is an instance of Zend_Queue_Stomp_FrameInterface

Returns

\$this;

Write a frame to the stomp server

write(\Zend_Queue_Stom_FrameInterface $frame) : \Zend_Queue_Stomp_Client_Connection

example: $response = $client->write($frame)->read();

inherited_from \Zend_Queue_Stomp_Client_ConnectionInterface::write()
fluent This method is part of a fluent interface and will return the same instance

Parameters

$frame

\Zend_Queue_Stom_FrameInterface

Returns

\Zend_Queue_Stomp_Client_Connection

 Properties

 

Connection options

$_options : array

Default

 

tcp/udp socket

$_socket : resource

Default

false

 Constants

 

READ_TIMEOUT_DEFAULT_SEC

READ_TIMEOUT_DEFAULT_SEC = 5 
 

READ_TIMEOUT_DEFAULT_USEC

READ_TIMEOUT_DEFAULT_USEC = 0