def start_worker(cls, connection, address):
try:
RLXWorker.run(connection, address)
except KeyboardInterrupt:
pass
finally:
log.debug('Closing connection %s:%d' % address)
if sys.platform == 'win32':
os._exit(-1)
else:
try:
connection.shutdown(socket.SHUT_RDWR)
except socket.error as e:
# we don't care if the socket is already closed;
# this will often be the case if client closed connection first
if e.errno != errno.ENOTCONN:
raise
finally:
connection.close()
评论列表
文章目录