采用Udp协议服务端在接收消息时,若客户端退出后,接收消息会一直报10054-连接重置异常,导致无法接收新的消息。
解决方案:
const int SIP_UDP_CONNRESET=-1744830452; socket.IOControl(SIP_UDP_CONNRESET, new byte[] {0, 0, 0, 0}, null);