Allow WSL to work correctly by binding to ADDR_ANY

This change allows it to work correctly on WSL, since WSL must be bound to ADDR_ANY. The overall behavior remains unchanged.
This commit is contained in:
ErLullo
2026-02-18 17:44:08 +01:00
committed by GitHub
parent 1a2cf280b6
commit 23ba2d7cdf

View File

@@ -157,7 +157,7 @@ int socket_bind(const char * ip, int port, int protocol)
sa.sin_family = AF_INET; sa.sin_family = AF_INET;
//윈도우 서버는 개발용으로만 쓰기 때문에 BIND ip를 INADDR_ANY로 고정 //윈도우 서버는 개발용으로만 쓰기 때문에 BIND ip를 INADDR_ANY로 고정
//(테스트의 편의성을 위해) //(테스트의 편의성을 위해)
#ifndef OS_WINDOWS #ifdef OS_FREEBSD
sa.sin_addr.s_addr = inet_addr(ip); sa.sin_addr.s_addr = inet_addr(ip);
#else #else
sa.sin_addr.s_addr = INADDR_ANY; sa.sin_addr.s_addr = INADDR_ANY;