skyline
skyline copied to clipboard
Break the loop when connection closes.
At the moment when f.ex. carbon-relay will be restarted on the other side listener will end up in infinite loop reading 0 bytes all the time.
When a recv returns 0 bytes, it means the other side has closed (or is in the process of closing) the connection - https://docs.python.org/2/howto/sockets.html