Ensure Session is made in new thread
This commit is contained in:
parent
01d2b34452
commit
731c516a3a
1 changed files with 5 additions and 2 deletions
|
@ -34,8 +34,11 @@ class Server():
|
||||||
while True:
|
while True:
|
||||||
sock, addr = listener.accept()
|
sock, addr = listener.accept()
|
||||||
|
|
||||||
session = Session(self, sock)
|
def spawn():
|
||||||
thread = threading.Thread(target=session.handle)
|
session = Session(self, sock)
|
||||||
|
session.handle()
|
||||||
|
|
||||||
|
thread = threading.Thread(target=spawn)
|
||||||
thread.start()
|
thread.start()
|
||||||
|
|
||||||
listener.close()
|
listener.close()
|
||||||
|
|
Loading…
Add table
Reference in a new issue