Removed socket.isconnected()-statement