示例#1
0
        public bool Listen(int port)
        {
            EndListen();

            asyncListener         = new AsyncListener(port);
            asyncListener.Accept += AsyncListener_Accept;
            asyncListener.Start();

            return(true);
        }
示例#2
0
        public bool Listen(int port)
        {
            EndListen();

            try
            {
                asyncListener         = new AsyncListener(port);
                asyncListener.Accept += AsyncListener_Accept;
                asyncListener.Start();
            }
            catch (SocketException)
            {
                asyncListener = null;
                return(false);
            }

            return(true);
        }