class EchoServerProtocol(EchoProtocol):
'''The :class:`EchoProtocol` used by the echo :func:`server`.
'''
@asyncio.coroutine
def do_find_one(self):
return '23567898'
def response(self, data, rest):
self.transport.write(data)
data = data[:-len(self.separator)]
self.connection.logger.info(data)
phone = self._loop.run_until_complete(self.do_fine_one())
self.connection.logger.info(phone)
# If we get a QUIT message, close the transport.
# Used by the test suite.
if data == b'QUIT':
self.transport.close()
return data