private function readResponse() {
        $lines = null;
        while (trim($line = fgets($this->connection)) != '') {
            $lines .= $line;
            if (substr($line, 3, 1) == ' ')
                break;
        }
        $data = stream_get_meta_data($this->connection);
        if ($data['timed_out'])
            throw new RuntimeException('Timeout on socket connection');

        $this->logResponse($lines);
        return $lines;
    }