diff --git a/src/Engine/AbstractSocketIO.php b/src/Engine/AbstractSocketIO.php index b30745d..e647e0c 100644 --- a/src/Engine/AbstractSocketIO.php +++ b/src/Engine/AbstractSocketIO.php @@ -99,8 +99,8 @@ public function read() // the second byte contains the mask bit and the payload's length $data .= $part = fread($this->stream, 1); - $length = (int) (bin2hex($part) & ~0x80); // removing the mask bit - $mask = (bool) (bin2hex($part) & 0x80); + $length = hexdec(bin2hex($part) & ~0x80); // removing the mask bit + $mask = (bool)(bin2hex($part) & 0x80); /* * Here is where it is getting tricky :