protected function read()
    {
        $data = '';

        // TODO Invesigate if a time out is required
        do {
            if ($this->socket->closed()) {
                throw new Exception\ConnectionDroppedException('The connection has been dropped.');
            }

            $data .= $this->socket->read();
        } while (!preg_match($this->responseEnding, $data));

        return utf8_decode(substr($data, 4));
    }
protected function read()
    {
        $data = '';

        // TODO Invesigate if a time out is required
        do {
            if ($this->socket->closed()) {
                throw new Exception\ConnectionDroppedException('The connection has been dropped.');
            }

            $data .= $this->socket->read();
        } while (!preg_match($this->responseEnding, $data));

        return utf8_decode(substr($data, 4));
    }
protected function read ( ) { $ data = '' ; // TODO Invesigate if a time out is required do { if ( $ this -> socket -> closed ( ) ) { throw new Exception \ ConnectionDroppedException ( 'The connection has been dropped.' ) ; } $ data .= $ this -> socket -> read ( ) ; } while ( ! preg_match ( $ this -> responseEnding , $ data ) ) ; return utf8_decode ( substr ( $ data , 4 ) ) ; }
Retrieve a response from the server.

@return string

@throws ConnectionDroppedException

@todo Always UTF8 decode?
Retrieve a response from the server .