Hey all,
I've been experimenting with a basic chat server/client from my Python textbook, in efforts to keep the code clean and simple I think some optional code was omitted and it's made the books example a little buggy.
I've been having troubles with the line:
transmission = self.request.recv(1024)
This is server side, awaiting information from a client.
The problem I'm having is if a client connects, sends chat for a while and then disconnects in a non expected way (terminate the process, stop the execution of code, internet cuts out, etc) the server crashes.
So I believe this should be wrapped in a try
try:
transmission = self.request.recv(1024)
except: #should this be a specific exception only, or a general one
#What should I put here?
Any help on that last code snippet would be appreciated. Thanks!