Stop handling events if socket is closed.