Hoa central
Generic.php
Go to the documentation of this file.
1 <?php
2 
38 
39 use Hoa\Http;
40 use Hoa\Socket;
41 use Hoa\Websocket;
42 
51 abstract class Generic
52 {
58  protected $_connection = null;
59 
60 
61 
68  public function __construct(Socket\Connection $connection)
69  {
70  $this->_connection = $connection;
71 
72  return;
73  }
74 
82  abstract public function doHandshake(Http\Request $request);
83 
90  abstract public function readFrame();
91 
102  abstract public function writeFrame(
103  $message,
104  $opcode = Websocket\Connection::OPCODE_TEXT_FRAME,
105  $end = true,
106  $mask = false
107  );
108 
118  abstract public function send(
119  $message,
120  $opcode = Websocket\Connection::OPCODE_TEXT_FRAME,
121  $end = true,
122  $mask = false
123  );
124 
135  abstract public function close(
136  $code = Websocket\Connection::CLOSE_NORMAL,
137  $reason = null,
138  $mask = false
139  );
140 }
close($code=Websocket\Connection::CLOSE_NORMAL, $reason=null, $mask=false)
send($message, $opcode=Websocket\Connection::OPCODE_TEXT_FRAME, $end=true, $mask=false)
doHandshake(Http\Request $request)
writeFrame($message, $opcode=Websocket\Connection::OPCODE_TEXT_FRAME, $end=true, $mask=false)
__construct(Socket\Connection $connection)
Definition: Generic.php:68