jdk/src/windows/native/sun/nio/ch/DatagramChannelImpl.c
changeset 5777 1c86018749bd
parent 5506 202f599c92aa
child 7668 d4a77089c587
--- a/jdk/src/windows/native/sun/nio/ch/DatagramChannelImpl.c	Tue Jun 08 18:52:17 2010 -0700
+++ b/jdk/src/windows/native/sun/nio/ch/DatagramChannelImpl.c	Wed Jun 09 18:51:32 2010 +0100
@@ -120,6 +120,12 @@
     rv = connect((SOCKET)fd, (struct sockaddr *)&sa, sa_len);
     if (rv == SOCKET_ERROR) {
         handleSocketError(env, WSAGetLastError());
+    } else {
+        /* Disable WSAECONNRESET errors as socket is no longer connected */
+        BOOL enable = FALSE;
+        DWORD bytesReturned = 0;
+        WSAIoctl((SOCKET)fd, SIO_UDP_CONNRESET, &enable, sizeof(enable),
+                 NULL, 0, &bytesReturned, NULL, NULL);
     }
 }