/// <summary>
        /// 异步Socket UDP服务器
        /// </summary>
        /// <param name="localIPAddress">监听的IP地址</param>
        /// <param name="listenPort">监听的端口</param>
        /// <param name="maxClient">最大客户端数量</param>
        public AsyncSocketUDPServer(IPAddress localIPAddress, int listenPort)
        {
            this.Address  = localIPAddress;
            this.Port     = listenPort;
            this.Encoding = Encoding.Default;

            _serverSock = new Socket(localIPAddress.AddressFamily, SocketType.Dgram, ProtocolType.Udp);

            so = new AsyncSocketUDPState();
        }
예제 #2
0
 public AsyncSocketUDPEventArgs(string msg, AsyncSocketUDPState state)
 {
     this._msg   = msg;
     this._state = state;
     IsHandled   = false;
 }
예제 #3
0
 public AsyncSocketUDPEventArgs(AsyncSocketUDPState state)
 {
     this._state = state;
     IsHandled   = false;
 }