Minor cleanups
This commit is contained in:
parent
bf808d4c61
commit
0caa6e814b
@ -15,6 +15,8 @@ class MessageParser {
|
|||||||
$from->WebSocket->frame->addBuffer($data);
|
$from->WebSocket->frame->addBuffer($data);
|
||||||
if ($from->WebSocket->frame->isCoalesced()) {
|
if ($from->WebSocket->frame->isCoalesced()) {
|
||||||
if ($from->WebSocket->frame->getOpcode() > 2) {
|
if ($from->WebSocket->frame->getOpcode() > 2) {
|
||||||
|
// take action on the control frame
|
||||||
|
|
||||||
unset($from->WebSocket->frame);
|
unset($from->WebSocket->frame);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
@ -35,7 +35,6 @@ class Message implements MessageInterface {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
* @todo Should I allow addFrame if the frame is not coalesced yet? I believe I'm assuming this class will only receive fully formed frame messages
|
|
||||||
* @todo Also, I should perhaps check the type...control frames (ping/pong/close) are not to be considered part of a message
|
* @todo Also, I should perhaps check the type...control frames (ping/pong/close) are not to be considered part of a message
|
||||||
*/
|
*/
|
||||||
public function addFrame(FrameInterface $fragment) {
|
public function addFrame(FrameInterface $fragment) {
|
||||||
|
15
WsServer.php
15
WsServer.php
@ -17,6 +17,7 @@ class WsServer implements MessageComponentInterface {
|
|||||||
* Negotiates upgrading the HTTP connection to a WebSocket connection
|
* Negotiates upgrading the HTTP connection to a WebSocket connection
|
||||||
* It contains useful configuration properties and methods
|
* It contains useful configuration properties and methods
|
||||||
* @var HandshakeNegotiator
|
* @var HandshakeNegotiator
|
||||||
|
* @note May not expose this in the future, may do through facade methods
|
||||||
*/
|
*/
|
||||||
public $handshaker;
|
public $handshaker;
|
||||||
|
|
||||||
@ -36,18 +37,6 @@ class WsServer implements MessageComponentInterface {
|
|||||||
*/
|
*/
|
||||||
protected $messager;
|
protected $messager;
|
||||||
|
|
||||||
/**
|
|
||||||
* Re-entrant instances of protocol version classes
|
|
||||||
* @internal
|
|
||||||
*/
|
|
||||||
protected $_versions = array(
|
|
||||||
'HyBi10' => null
|
|
||||||
, 'Hixie76' => null
|
|
||||||
, 'RFC6455' => null
|
|
||||||
);
|
|
||||||
|
|
||||||
protected $_mask_payload = false;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* For now, array_push accepted subprotocols to this array
|
* For now, array_push accepted subprotocols to this array
|
||||||
* @deprecated
|
* @deprecated
|
||||||
@ -177,6 +166,6 @@ class WsServer implements MessageComponentInterface {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return substr($string, 0, -1);
|
return mb_substr($string, 0, -1, 'ASCII');
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user