Catch socket error in server.

parent 96d89030
...@@ -106,7 +106,7 @@ class RequestHandler(AsyncBase, asyncore.dispatcher): ...@@ -106,7 +106,7 @@ class RequestHandler(AsyncBase, asyncore.dispatcher):
elif chunk == '\n' and buf[-1] == '\r': elif chunk == '\n' and buf[-1] == '\r':
break break
buf += chunk buf += chunk
except SocketError: except SocketError, socket.error:
self.log.info('client %s:%d disconnected or socket is broken.' \ self.log.info('client %s:%d disconnected or socket is broken.' \
% self.address) % self.address)
self.server.disconnect_client(self.address) self.server.disconnect_client(self.address)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment