Hoa central
Public Member Functions | Protected Attributes | List of all members
Hoa\Websocket\Node Class Reference
Inheritance diagram for Hoa\Websocket\Node:

Public Member Functions

 setProtocolImplementation (Protocol\Generic $protocol)
 
 getProtocolImplementation ()
 
 setHandshake ($handshake)
 
 getHandshake ()
 
 appendMessageFragment ($fragment)
 
 getFragmentedMessage ()
 
 getNumberOfFragments ()
 
 setComplete ($complete)
 
 isMessageComplete ()
 
 setBinary ($binary)
 
 isBinary ()
 
 clearFragmentation ()
 
- Public Member Functions inherited from Hoa\Socket\Node
 __construct ($id, $socket, Connection $connection)
 
 getId ()
 
 getSocket ()
 
 getConnection ()
 
 setEncryptionType ($type)
 
 getEncryptionType ()
 

Protected Attributes

 $_protocol = null
 
 $_handshake = false
 
 $_messageFragments = null
 
 $_numberOfFragments = 0
 
 $_complete = true
 
 $_isBinary = false
 
- Protected Attributes inherited from Hoa\Socket\Node
 $_id = null
 
 $_encryptionType = null
 

Detailed Description

Class .

Describe a websocket node.

Definition at line 49 of file Node.php.

Member Function Documentation

Hoa\Websocket\Node::appendMessageFragment (   $fragment)

Append a fragment to a message (if we have fragmentation).

Parameters
string$fragmentFragment.
Returns
string

Definition at line 147 of file Node.php.

148  {
149  ++$this->_numberOfFragments;
150 
151  return $this->_messageFragments .= $fragment;
152  }
Hoa\Websocket\Node::clearFragmentation ( )

Clear the fragmentation.

Returns
string

Definition at line 227 of file Node.php.

228  {
229  unset($this->_messageFragments);
230  $this->_numberOfFragments = 0;
231  $this->_isBinary = false;
232  $this->_complete = true;
233 
234  return;
235  }
Hoa\Websocket\Node::getFragmentedMessage ( )

Get the fragmented message.

Returns
string

Definition at line 159 of file Node.php.

160  {
161  return $this->_messageFragments;
162  }
Hoa\Websocket\Node::getHandshake ( )

Whether the handshake succeed.

Returns
bool

Definition at line 136 of file Node.php.

137  {
138  return $this->_handshake;
139  }
Hoa\Websocket\Node::getNumberOfFragments ( )

Get number of fragments.

Returns
int

Definition at line 169 of file Node.php.

170  {
171  return $this->_numberOfFragments;
172  }
Hoa\Websocket\Node::getProtocolImplementation ( )

Get protocol implementation.

Returns

Definition at line 112 of file Node.php.

113  {
114  return $this->_protocol;
115  }
Hoa\Websocket\Node::isBinary ( )

Check if the message is binary or not.

Returns
bool

Definition at line 217 of file Node.php.

218  {
219  return $this->_isBinary;
220  }
Hoa\Websocket\Node::isMessageComplete ( )

Check if the message is complete or not.

Returns
bool

Definition at line 193 of file Node.php.

194  {
195  return $this->_complete;
196  }
Hoa\Websocket\Node::setBinary (   $binary)

Whether the message is binary or not.

Parameters
bool$binaryBinary.
Returns
bool

Definition at line 204 of file Node.php.

205  {
206  $old = $this->_isBinary;
207  $this->_isBinary = $binary;
208 
209  return $old;
210  }
Hoa\Websocket\Node::setComplete (   $complete)

Set whether the message is complete or not.

Parameters
bool$completeIs it complete?
Returns
bool

Definition at line 180 of file Node.php.

181  {
182  $old = $this->_complete;
183  $this->_complete = $complete;
184 
185  return $old;
186  }
Hoa\Websocket\Node::setHandshake (   $handshake)

Set handshake success.

Parameters
bool$handshakeHandshake.
Returns
bool

Definition at line 123 of file Node.php.

124  {
125  $old = $this->_handshake;
126  $this->_handshake = $handshake;
127 
128  return $old;
129  }
Hoa\Websocket\Node::setProtocolImplementation ( Protocol\Generic  $protocol)

Set protocol implementation.

Parameters
\Hoa\Websocket\Protocol\Generic$protocolProtocol.
Returns

Definition at line 99 of file Node.php.

100  {
101  $old = $this->_protocol;
102  $this->_protocol = $protocol;
103 
104  return $old;
105  }

Member Data Documentation

Hoa\Websocket\Node::$_complete = true
protected

Whether the message is complete or not.

Definition at line 82 of file Node.php.

Hoa\Websocket\Node::$_handshake = false
protected

Definition at line 63 of file Node.php.

Hoa\Websocket\Node::$_isBinary = false
protected

Definition at line 89 of file Node.php.

Hoa\Websocket\Node::$_messageFragments = null
protected

Definition at line 70 of file Node.php.

Hoa\Websocket\Node::$_numberOfFragments = 0
protected

Definition at line 77 of file Node.php.

Hoa\Websocket\Node::$_protocol = null
protected

Definition at line 56 of file Node.php.


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