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:
|
||||
sock, addr = listener.accept()
|
||||
|
||||
session = Session(self, sock)
|
||||
thread = threading.Thread(target=session.handle)
|
||||
def spawn():
|
||||
session = Session(self, sock)
|
||||
session.handle()
|
||||
|
||||
thread = threading.Thread(target=spawn)
|
||||
thread.start()
|
||||
|
||||
listener.close()
|
||||
|
|
Loading…
Add table
Reference in a new issue