aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIvan Enderlin <ivan.enderlin@hoa-project.net>2016-05-27 21:21:33 +0200
committerIvan Enderlin <ivan.enderlin@hoa-project.net>2016-06-17 17:04:44 +0200
commit3f559f7dcb62af9bd6e0bd572819e6bab1a631ce (patch)
treef87274fd10b102df61471750c1c19e37f4e14d5f
parentc7d929f4f75dcefd318c90314edc4ad5faba0883 (diff)
downloadWebsocket-3f559f7dcb62af9bd6e0bd572819e6bab1a631ce.zip
Websocket-3f559f7dcb62af9bd6e0bd572819e6bab1a631ce.tar.gz
Websocket-3f559f7dcb62af9bd6e0bd572819e6bab1a631ce.tar.bz2
Protocol: Use the `getConnection` method.
-rw-r--r--Protocol/Hybi00.php9
1 files changed, 5 insertions, 4 deletions
diff --git a/Protocol/Hybi00.php b/Protocol/Hybi00.php
index 36ee463..c26f119 100644
--- a/Protocol/Hybi00.php
+++ b/Protocol/Hybi00.php
@@ -82,7 +82,8 @@ class Hybi00 extends Generic
$challenge = $part1 . $part2 . $key3;
$response = md5($challenge, true);
- $this->_connection->writeAll(
+ $connection = $this->getConnection();
+ $connection->writeAll(
'HTTP/1.1 101 WebSocket Protocol Handshake' . "\r\n" .
'Upgrade: WebSocket' . "\r\n" .
'Connection: Upgrade' . "\r\n" .
@@ -91,7 +92,7 @@ class Hybi00 extends Generic
"\r\n" .
$response . "\r\n"
);
- $this->_connection->getCurrentNode()->setHandshake(SUCCEED);
+ $connection->getCurrentNode()->setHandshake(SUCCEED);
return;
}
@@ -103,7 +104,7 @@ class Hybi00 extends Generic
*/
public function readFrame()
{
- $buffer = $this->_connection->read(2048);
+ $buffer = $this->getConnection()->read(2048);
$length = strlen($buffer) - 2;
if (empty($buffer)) {
@@ -146,7 +147,7 @@ class Hybi00 extends Generic
$end = true,
$mask = false
) {
- return $this->_connection->writeAll(
+ return $this->getConnection()->writeAll(
chr(0) . $message . chr(255)
);
}