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

Public Member Functions

 __construct (Socket\Connection $connection)
 
 doHandshake (Http\Request $request)
 
 readFrame ()
 
 writeFrame ($message, $opcode=Websocket\Connection::OPCODE_TEXT_FRAME, $end=true, $mask=false)
 
 send ($message, $opcode=Websocket\Connection::OPCODE_TEXT_FRAME, $end=true, $mask=false)
 
 close ($code=Websocket\Connection::CLOSE_NORMAL, $reason=null, $mask=false)
 

Protected Attributes

 $_connection = null
 

Detailed Description

Class .

An abstract protocol implementation.

Definition at line 51 of file Generic.php.

Constructor & Destructor Documentation

Hoa\Websocket\Protocol\Generic::__construct ( Socket\Connection  $connection)

Construct the protocol implementation.

Parameters
\Hoa\Socket\Connection$connectionConnection.
Returns
void

Definition at line 68 of file Generic.php.

69  {
70  $this->_connection = $connection;
71 
72  return;
73  }

Member Function Documentation

Hoa\Websocket\Protocol\Generic::close (   $code = Websocket\Connection::CLOSE_NORMAL,
  $reason = null,
  $mask = false 
)
abstract

Close a specific node/connection.

Parameters
int$codeCode (please, see ::CLOSE_* constants).
string$reasonReason.
bool$maskWhether the message will be masked or not.
Returns
void
Hoa\Websocket\Protocol\Generic::doHandshake ( Http\Request  $request)
abstract

Do the handshake.

Parameters
\Hoa\Http\Request$requestRequest.
Returns
void
Exceptions
Hoa\Websocket\Protocol\Generic::readFrame ( )
abstract

Read a frame.

Returns
array
Exceptions
Hoa\Websocket\Protocol\Generic::send (   $message,
  $opcode = Websocket\Connection::OPCODE_TEXT_FRAME,
  $end = true,
  $mask = false 
)
abstract

Send a message to a node (if not specified, current node).

Parameters
string$messageMessage.
int$opcodeOpcode.
bool$endWhether it is the last frame of the message.
bool$maskWhether the message will be masked or not.
Returns
void
Hoa\Websocket\Protocol\Generic::writeFrame (   $message,
  $opcode = Websocket\Connection::OPCODE_TEXT_FRAME,
  $end = true,
  $mask = false 
)
abstract

Write a frame.

Parameters
string$messageMessage.
int$opcodeOpcode.
bool$endWhether it is the last frame of the message.
bool$maskWhether the message will be masked or not.
Returns
int
Exceptions

Member Data Documentation

Hoa\Websocket\Protocol\Generic::$_connection = null
protected

Definition at line 58 of file Generic.php.


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