public static void Stop() { if (singleton == null) { throw new InvalidOperationException("The UdpListenerAdapter is not started."); } singleton.Close(); singleton = null; }