我用udp发往localhost的一个没有进程鉴听的端口,但却没有返回错误,返回的是
发出的字节数。请问为什么?

解决方案 »

  1.   

    udp本来就不管对方能不能收到
      

  2.   

    但是sendto可以返回SOCKET_ERROR啊,MSDN里说WSAGetLastError()会返回WSAECONNRESETWSAECONNRESET 
    The virtual circuit was reset by the remote side executing a "hard" or "abortive" close. For UPD sockets, the remote host was unable to deliver a previously sent UDP datagram and responded with a "Port Unreachable" ICMP packet. The application should close the socket as it is no longer usable.
      

  3.   

    你是否搞错哪?在2000下测试返回WSAECONNRESET
    至于其他的系统就...
      

  4.   

    我是发送到localhost的,就是没有出错