Reputation: 19
how can I detect that a socket I am currently listening at with recv()
has been closed?
Upvotes: 1
Views: 900
Reputation: 596713
socket.recv()
will return an empty byte array if the peer has closed the connection gracefully. Otherwise it will raise an error.
Upvotes: 1