From e449d315add965f4dbbaabf59a11e6c34e783d67 Mon Sep 17 00:00:00 2001 From: fearworksmedia Date: Sun, 21 Nov 2021 16:57:08 +0000 Subject: [PATCH] Modified UDPreateListenSocket() Modified UDPCreateListenSocket to include a specified ip address to bind socket to (by directing getaddrinfo() to look for a specific IP address instead of NULL, which seems to stop at the first default address, which if an IPv6 address, means we cannot create a listen socket if the system is IPv4) --- LBNet/LBNet-UDP.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/LBNet/LBNet-UDP.cpp b/LBNet/LBNet-UDP.cpp index 48290a9..1225f90 100644 --- a/LBNet/LBNet-UDP.cpp +++ b/LBNet/LBNet-UDP.cpp @@ -61,9 +61,9 @@ LBNET_API int __stdcall UDPReceive(SOCKET s, LPSTR buffer, ULONG bufLen, PLBNetU return retVal; } -LBNET_API SOCKET __stdcall UDPCreateListenSocket(LPCSTR pService) +LBNET_API SOCKET __stdcall UDPCreateListenSocket(LPCSTR address, LPCSTR pService) { - return CreateListenSocketInternal(pService, IPPROTO_UDP); + return CreateListenSocketInternal(address, pService, IPPROTO_UDP); } LBNET_API LPCSTR __stdcall UDPGetRemoteIP(PLBNetUDPInfo udpInfo)