public static void Stop() { if (singleton == null) { throw new InvalidOperationException("The UdpListenerAdapter is not started."); } singleton.Close(); singleton = null; }
public static void Start() { if (singleton != null) { throw new InvalidOperationException("Only one instance of UdpListenerAdapter is allowed."); } singleton = new UdpListenerAdapter(); singleton.Open(); }