how can I detect that a socket I am currently listening at with recv() has been closed?
socket.recv() will return an empty byte array if the peer has closed the connection gracefully. Otherwise it will raise an error.
How can you detect a socket has been closed while waiting on recv?