Break on connection closed during socket.recv()