Naming conventions

This commit is contained in:
Chris Boden 2016-02-25 19:26:42 -05:00
parent 5137c2122a
commit 01e1d159e8
2 changed files with 7 additions and 10 deletions

View File

@ -11,10 +11,10 @@ class ConnContext {
/** /**
* @var \Ratchet\RFC6455\Messaging\MessageBuffer; * @var \Ratchet\RFC6455\Messaging\MessageBuffer;
*/ */
public $streamer; public $buffer;
public function __construct(WsConnection $conn, MessageBuffer $streamer) { public function __construct(WsConnection $conn, MessageBuffer $buffer) {
$this->connection = $conn; $this->connection = $conn;
$this->streamer = $streamer; $this->buffer = $buffer;
} }
} }

View File

@ -127,8 +127,7 @@ class WsServer implements HttpServerInterface {
return; return;
} }
$context = $this->connections[$from]; $this->connections[$from]->buffer->onData($msg);
$context->streamer->onData($msg);
} }
/** /**
@ -139,7 +138,7 @@ class WsServer implements HttpServerInterface {
$context = $this->connections[$conn]; $context = $this->connections[$conn];
$this->connections->detach($conn); $this->connections->detach($conn);
$this->delegate->onClose($context->conn); $this->delegate->onClose($context->connection);
} }
} }
@ -148,8 +147,7 @@ class WsServer implements HttpServerInterface {
*/ */
public function onError(ConnectionInterface $conn, \Exception $e) { public function onError(ConnectionInterface $conn, \Exception $e) {
if ($this->connections->contains($conn)) { if ($this->connections->contains($conn)) {
$context = $this->connections[$conn]; $this->delegate->onError($this->connections[$from]->connection, $e);
$this->delegate->onError($context->connection, $e);
} else { } else {
$conn->close(); $conn->close();
} }
@ -194,8 +192,7 @@ class WsServer implements HttpServerInterface {
$lastPing = new Frame(uniqid(), true, Frame::OP_PING); $lastPing = new Frame(uniqid(), true, Frame::OP_PING);
foreach ($this->connections as $key => $conn) { foreach ($this->connections as $key => $conn) {
$context = $this->connections[$conn]; $wsConn = $this->connections[$from]->connection;
$wsConn = $context->connection;
$wsConn->send($lastPing); $wsConn->send($lastPing);
$pingedConnections->attach($wsConn); $pingedConnections->attach($wsConn);