Commit dadeedb6 authored by chenzhengzhang's avatar chenzhengzhang
Browse files

[trac419] fix some minor issues according to review comments

parent 91193e42
......@@ -345,6 +345,13 @@ class UnixSockServer(socketserver_mixin.NoPollMixIn, ThreadingUnixStreamServer):
% str(client_address))
break
def _handle_request_noblock(self):
"""Overide the function _handle_request_noblock(), it create a new thread to
handle requests for each auth"""
td = threading.Thread(target=self.handle_request)
td.setDaemon(True)
td.start()
def process_request(self, request):
"""Receive socket fd and query message from auth, then
start a new thread to process the request."""
......
......@@ -78,8 +78,7 @@ class NoPollMixIn:
if self.__read_sock in r:
break
else:
# Create a new thread to handle requests for each auth
threading.Thread(target=self.handle_request).start()
self._handle_request_noblock();
self._is_shut_down.set()
......
......@@ -25,7 +25,7 @@ class MyHandler(socketserver.BaseRequestHandler):
data = self.request.recv(20)
self.request.send(data)
class MyServer(NoPollMixIn,
class MyServer(NoPollMixIn,
socketserver.ThreadingMixIn,
socketserver.TCPServer):
......
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