Index: trunk/src/wsock32/makefile
===================================================================
--- trunk/src/wsock32/makefile	(revision 3170)
+++ trunk/src/wsock32/makefile	(revision 3171)
@@ -1,3 +1,3 @@
-# $Id: makefile,v 1.21 2000-03-17 16:06:42 sandervl Exp $
+# $Id: makefile,v 1.22 2000-03-20 20:31:29 sandervl Exp $
 
 #
@@ -36,4 +36,6 @@
 # Target name - name of the dll without extention and path.
 TARGET = wsock32
+
+CXXFLAGS = $(CXXFLAGS)
 
 
Index: trunk/src/wsock32/relaywin.cpp
===================================================================
--- trunk/src/wsock32/relaywin.cpp	(revision 3170)
+++ trunk/src/wsock32/relaywin.cpp	(revision 3171)
@@ -78,4 +78,5 @@
                  ULONG ulMsg,
                  ULONG ulRequestType,
+	         ULONG socket,
                  BOOL  fSingleRequestPerWindow,
                  PVOID pvUserData1,
@@ -96,4 +97,5 @@
 	      	arrHwndMsgPair[ulCounter].ulMsg         = ulMsg;
 	      	arrHwndMsgPair[ulCounter].ulRequestType = ulRequestType;
+	      	arrHwndMsgPair[ulCounter].socket        = socket;
 	      	arrHwndMsgPair[ulCounter].pvUserData1   = pvUserData1;
 	      	arrHwndMsgPair[ulCounter].pvUserData2   = pvUserData2;
@@ -130,4 +132,5 @@
   arrHwndMsgPair[ulID-1].ulMsg = 0;
   arrHwndMsgPair[ulID-1].ulRequestType = 0;
+  arrHwndMsgPair[ulID-1].socket = 0;
   arrHwndMsgPair[ulID-1].pvUserData1 = 0;
   arrHwndMsgPair[ulID-1].pvUserData2 = 0;
@@ -151,5 +154,5 @@
  *****************************************************************************/
 
-ULONG RelayFreeByHwnd(HWND hwnd)
+ULONG RelayFreeByHwnd(ULONG socket, HWND hwnd)
 {
   ULONG ulCounter;
@@ -158,9 +161,11 @@
   for(ulCounter = 0; ulCounter < MAX_ASYNC_SOCKETS; ulCounter++)
   {
-    	if ( arrHwndMsgPair[ulCounter].hwnd == hwnd )  // same window?
+    	if (arrHwndMsgPair[ulCounter].hwnd == hwnd &&
+            arrHwndMsgPair[ulCounter].socket == socket)  // same window && socket?
     	{
       		arrHwndMsgPair[ulCounter].hwnd  = 0; // free slot
   		arrHwndMsgPair[ulCounter].ulMsg = 0;
   		arrHwndMsgPair[ulCounter].ulRequestType = 0;
+  		arrHwndMsgPair[ulCounter].socket = 0;
   		arrHwndMsgPair[ulCounter].pvUserData1 = 0;
   		arrHwndMsgPair[ulCounter].pvUserData2 = 0;
@@ -244,5 +249,8 @@
       case ASYNCREQUEST_SELECT:
       {
-        dprintf(("WSOCK32:RelayWindowProc, AsyncSelect notification %x %x (%d,%d) time %x\n", pHM->hwnd, pHM->ulMsg, mp1, mp2, WinQueryMsgTime(hab)));
+        dprintf(("WSOCK32:RelayWindowProc, AsyncSelect notification %x %x (%x,%x) time %x\n", pHM->hwnd, pHM->ulMsg, mp1, mp2, WinQueryMsgTime(hab)));
+	if(SHORT2FROMMP(mp2) == WSAECONNREFUSED) {
+		mp2 = (MPARAM)((WSAENOTCONN << 16) | 0x10);
+	}
         break;
       }
Index: trunk/src/wsock32/relaywin.h
===================================================================
--- trunk/src/wsock32/relaywin.h	(revision 3170)
+++ trunk/src/wsock32/relaywin.h	(revision 3171)
@@ -1,3 +1,3 @@
-/* $Id: relaywin.h,v 1.1 1999-12-07 20:25:48 achimha Exp $ */
+/* $Id: relaywin.h,v 1.2 2000-03-20 20:31:30 sandervl Exp $ */
 
 /*
@@ -47,4 +47,6 @@
 
 
+#define  NO_SOCKET                      -1
+
 typedef struct tagHwndMsgPair
 {
@@ -52,4 +54,5 @@
   ULONG ulMsg; /* the message code to send */
   ULONG ulRequestType; /* the type of request that this belongs to */
+  ULONG socket;
   PVOID pvUserData1; /* request specific data field */
   PVOID pvUserData2; /* request specific data field */
@@ -65,4 +68,5 @@
                                  ULONG ulMsg, 
                                  ULONG ulRequestType,
+				 ULONG socket,
                                  BOOL  fSingleRequestPerWindow,
                                  PVOID pvUserData1 = 0, 
@@ -72,5 +76,5 @@
 ULONG            RelayFree      (ULONG ulID);
 
-ULONG            RelayFreeByHwnd(HWND  hwnd);
+ULONG            RelayFreeByHwnd(ULONG socket, HWND  hwnd);
 
 PHWNDMSGPAIR     RelayQuery     (ULONG ulID);
Index: trunk/src/wsock32/wsock32.cpp
===================================================================
--- trunk/src/wsock32/wsock32.cpp	(revision 3170)
+++ trunk/src/wsock32/wsock32.cpp	(revision 3171)
@@ -1,3 +1,3 @@
-/* $Id: wsock32.cpp,v 1.20 2000-03-17 16:06:42 sandervl Exp $ */
+/* $Id: wsock32.cpp,v 1.21 2000-03-20 20:31:30 sandervl Exp $ */
 
 /*
@@ -1202,4 +1202,5 @@
                        wMsg,
                        ASYNCREQUEST_GETSERVBYNAME,
+  	 	       NO_SOCKET, 
                        FALSE,
                        buf);
@@ -1252,4 +1253,5 @@
                        wMsg,
                        ASYNCREQUEST_GETSERVBYPORT,
+  	 	       NO_SOCKET, 
                        FALSE,
                        buf);
@@ -1301,4 +1303,5 @@
                        wMsg,
                        ASYNCREQUEST_GETPROTOBYNAME,
+  	 	       NO_SOCKET, 
                        FALSE,
                        buf);
@@ -1349,4 +1352,5 @@
                        wMsg,
                        ASYNCREQUEST_GETPROTOBYNUMBER,
+  	 	       NO_SOCKET, 
                        FALSE,
                        buf);
@@ -1399,4 +1403,5 @@
                        wMsg,
                        ASYNCREQUEST_GETHOSTBYNAME,
+  	 	       NO_SOCKET, 
                        FALSE,
                        (PVOID)buf, (PVOID)buflen);
@@ -1449,4 +1454,5 @@
                        wMsg,
                        ASYNCREQUEST_GETHOSTBYADDR,
+  	 	       NO_SOCKET, 
                        FALSE,
                        buf);
@@ -1536,5 +1542,5 @@
   {
     // remove entry from list
-    RelayFreeByHwnd(hWnd);
+    RelayFreeByHwnd(s, hWnd);
   }
   else
@@ -1543,6 +1549,6 @@
                          wMsg,
                          ASYNCREQUEST_SELECT,
+			 s, 
 			 FALSE); //SvL: allow multiple selects -> pmwsock should fail if it not allowed
-//                         TRUE);
 
   rc = WSAAsyncSelect(s,
