line = self._rfile.readline()
if not line.endswith("\n"):
raise ConnectionError, "Connection lost while reading MPD hello"
line = self._rfile.readline()
if not line.endswith("\n"):
raise ConnectionError, "Connection lost while reading MPD hello"
if not line.startswith(HELLO_PREFIX):
raise ProtocolError, "Got invalid MPD hello: '%s'" % line
self.mpd_version = line[len(HELLO_PREFIX):].strip()
if not line.startswith(HELLO_PREFIX):
raise ProtocolError, "Got invalid MPD hello: '%s'" % line
self.mpd_version = line[len(HELLO_PREFIX):].strip()