Socket error 10052 on UDP socket

后端 未结 3 1355
我寻月下人不归
我寻月下人不归 2021-01-11 13:29

We have a .NET 2.0 desktop application which sends and receives network packets over UDP.

Several users have reported an occasional socket error 10052 which happens

3条回答
  •  花落未央
    2021-01-11 14:30

    WSAE NET RESET suggests that it happens due to a reset of the network interface itself. Your program is sitting there bound to a UDP port, so in a sense it is connected, but to the network interface rather than to a remote peer.

    Try starting your program, getting it to the point where this BeginReceiveFrom call is about to be made, then disable your NIC in the Device Manager and re-enable it. Or, with Wi-Fi, drop and reestablish the connection to the WAP. It might even happen by just unplugging the Ethernet cable to your machine, as recent versions of Windows default to killing all sockets connected through that NIC when this happens.

    It would explain the rare problem reports from the field. This probably only happens when there is some local networking fault at the hardware level.

提交回复
热议问题