diff --git a/websockets.php b/websockets.php index 805d59a..dc3e7c4 100644 --- a/websockets.php +++ b/websockets.php @@ -130,7 +130,7 @@ public function run() { } $buffer = fread($socket, $this->maxBufferSize); - $numBytes = count($buffer); + $numBytes = strlen($buffer); if ($numBytes == 0) { $this->disconnect($socket); $this->stderr("Client disconnected. TCP connection lost: " . $socket);