public function readLine()
    {
        do {
            $line = rtrim(fgets($this->socket));

            // server must have dropped the connection
            if ($line === '' && feof($this->socket)) {
                $this->close();

                return false;
            }
        } while ($line === '');

        return $line;
    }