Browse Source

Merge pull request #57 from Vincenz099/master

Fixed WSASend returning 1 instead of -1 on error.
NX 6 years ago
parent
commit
ab4161e2f0
1 changed files with 2 additions and 2 deletions
  1. 2 2
      Source/Native/enet.h

+ 2 - 2
Source/Native/enet.h

@@ -5000,7 +5000,7 @@ extern "C" {
 			}
 			}
 
 
 			if (WSASendTo(socket, (LPWSABUF)buffers, (DWORD)bufferCount, &sentLength, 0, address != NULL ? (struct sockaddr*)&sin : NULL, address != NULL ? sizeof(struct sockaddr_in6) : 0, NULL, NULL) == SOCKET_ERROR)
 			if (WSASendTo(socket, (LPWSABUF)buffers, (DWORD)bufferCount, &sentLength, 0, address != NULL ? (struct sockaddr*)&sin : NULL, address != NULL ? sizeof(struct sockaddr_in6) : 0, NULL, NULL) == SOCKET_ERROR)
-				return (WSAGetLastError() == WSAEWOULDBLOCK) ? 0 : 1;
+				return (WSAGetLastError() == WSAEWOULDBLOCK) ? 0 : -1;
 
 
 			return (int)sentLength;
 			return (int)sentLength;
 		}
 		}
@@ -5082,4 +5082,4 @@ extern "C" {
 }
 }
 #endif
 #endif
 #endif
 #endif
-#endif
+#endif