I’m on Manjaro using SDL2_net
When I run the server, it exits immediately and I get the output:
bind_address: 127.0.0.1
SDLNet_TCP_Open: Couldn’t connect to remote host
IPaddress ip;
fprintf(stderr, "bind_address: %s\n", config.bind_address);
if (SDLNet_ResolveHost(&ip, config.bind_address, default_port) == -1) {
fprintf(stderr, "SDLNet_ResolveHost: %s\n", SDLNet_GetError());
SDLNet_Quit();
SDL_Quit();
return 1;
}
TCPsocket server = SDLNet_TCP_Open(&ip);
if (!server) {
fprintf(stderr, "SDLNet_TCP_Open: %s\n", SDLNet_GetError());
SDLNet_Quit();
SDL_Quit();
return 1;
}
It’s been working fine when using “NULL” or “0.0.0.0” as the second argument of SDLNet_ResolveHost
bind_address: 0.0.0.0
Server listening on 0.0.0.0:22777
Client 0 connected from 127.0.0.1:51488
Client 1 connected from 127.0.0.1:51490
I wanted to try binding to localhost host because my network tests are passing in Linux and MacOS GitHub runners, but failing in the Windows runner. I thought there’s a possibility that Windows was more restrictive about what addresses could be used in the runner.