/// <summary> /// 开始监听并接受连接请求 /// </summary> /// <returns></returns> public override void Accept() { if (this.Acceptor != null) { return; } this.Acceptor = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp); if (this.ServiceType == NetServiceType.Server) { #if WINDOWS uint IOC_IN = 0x80000000; uint IOC_VENDOR = 0x18000000; uint SIO_UDP_CONNRESET = IOC_IN | IOC_VENDOR | 12; this.Acceptor.IOControl((int)SIO_UDP_CONNRESET, new[] { Convert.ToByte(false) }, null); #endif } Acceptor.Bind(this.EndPoint); }