Search code examples
sdlsdl-2sdl-net

SDLNet detect not existing host


SDLNet_ResolveHost always return 0 no matter if there is any host on that IP and port. According to the documentation it should return -1 when an error occurs.

How can a non existing host be detected?


Solution

  • Ok, so I found the solution. SDLNet_TCP_Open will return NULL when an error occurs.