Index: tclWinSock.c
===================================================================
RCS file: /cvsroot/tcl/tcl/win/tclWinSock.c,v
retrieving revision 1.64
retrieving revision 1.65
diff -u -r1.64 -r1.65
--- tclWinSock.c	18 Dec 2008 01:14:17 -0000	1.64
+++ tclWinSock.c	26 Jan 2009 22:57:57 -0000	1.65
@@ -1627,11 +1627,23 @@
 	    break;
 	}
 
+	error = WSAGetLastError();
+
+	/*
+	 * If an RST comes, then ignore the error and report an EOF just like
+	 * on unix.
+	 */
+
+	if (error == WSAECONNRESET) {
+	    infoPtr->flags |= SOCKET_EOF;
+	    bytesRead = 0;
+	    break;
+	}
+
 	/*
 	 * Check for error condition or underflow in non-blocking case.
 	 */
 
-	error = WSAGetLastError();
 	if ((infoPtr->flags & SOCKET_ASYNC) || (error != WSAEWOULDBLOCK)) {
 	    TclWinConvertWSAError(error);
 	    *errorCodePtr = Tcl_GetErrno();
