Prevent further network event execution after socket has been closed