def __call__(self, reader, writer):
iproto = self.protocol_cls(reader)
oproto = self.protocol_cls(writer)
while not reader.at_eof():
try:
with async_timeout.timeout(self.timeout):
yield from self.processor.process(iproto, oproto)
except ConnectionError:
logger.debug('client has closed the connection')
writer.close()
except asyncio.TimeoutError:
logger.debug('timeout when processing the client request')
writer.close()
except asyncio.IncompleteReadError:
logger.debug('client has closed the connection')
writer.close()
except Exception:
# app exception
logger.exception('unhandled app exception')
writer.close()
writer.close()
评论列表
文章目录