Exemplo n.º 1
0
        public static void Stop()
        {
            if (singleton == null)
            {
                throw new InvalidOperationException("The UdpListenerAdapter is not started.");
            }

            singleton.Close();
            singleton = null;
        }
Exemplo n.º 2
0
        public static void Start()
        {
            if (singleton != null)
            {
                throw new InvalidOperationException("Only one instance of UdpListenerAdapter is allowed.");
            }

            singleton = new UdpListenerAdapter();
            singleton.Open();
        }