Wamp/Client.php
protected function read()
    {
        // Ignore first byte
        fread($this->socket, 1);

        // There is also masking bit, as MSB, bit it's 0
        $payloadLength = ord(fread($this->socket, 1));

        switch ($payloadLength) {
            case 126:
                $payloadLength = unpack('n', fread($this->socket, 2));
                $payloadLength = $payloadLength[1];
                break;
            case 127:
                //$this->stdout('error', "Next 8 bytes are 64bit uint payload length, not yet implemented, since PHP can't handle 64bit longs!");
                break;
        }

        return fread($this->socket, $payloadLength);
    }
protected function read()
    {
        // Ignore first byte
        fread($this->socket, 1);

        // There is also masking bit, as MSB, bit it's 0
        $payloadLength = ord(fread($this->socket, 1));

        switch ($payloadLength) {
            case 126:
                $payloadLength = unpack('n', fread($this->socket, 2));
                $payloadLength = $payloadLength[1];
                break;
            case 127:
                //$this->stdout('error', "Next 8 bytes are 64bit uint payload length, not yet implemented, since PHP can't handle 64bit longs!");
                break;
        }

        return fread($this->socket, $payloadLength);
    }
protected function read ( ) { // Ignore first byte fread ( $ this -> socket , 1 ) ; // There is also masking bit, as MSB, bit it's 0 $ payloadLength = ord ( fread ( $ this -> socket , 1 ) ) ; switch ( $ payloadLength ) { case 126 : $ payloadLength = unpack ( 'n' , fread ( $ this -> socket , 2 ) ) ; $ payloadLength = $ payloadLength [ 1 ] ; break ; case 127 : //$this->stdout('error', "Next 8 bytes are 64bit uint payload length, not yet implemented, since PHP can't handle 64bit longs!"); break ; } return fread ( $ this -> socket , $ payloadLength ) ; }
Read the buffer and return the oldest event in stack.

@see https://tools.ietf.org/html/rfc6455#section-5.2

@return string
Read the buffer and return the oldest event in stack .