Beispiel #1
0
        public virtual bool Listen(int port)
        {
            if (port <= 0 || port > 65535)
            {
                log.Error("请监听位于0-65535区间中的端口号.");

                return(false);
            }

            try
            {
                if (m_socket != null)
                {
                    m_socket.ListenLocal(port);
                    return(true);
                }

                return(false);
            }
            catch
            {
                return(false);
            }
        }