[SDL] SDL_net and open timeouts
simonk at axis.com
Mon Jul 8 12:50:00 PDT 2002
Greetings, developers of SDL and SDL_net!
I have a feature request for SDL_net. The thing is that I would want
to be able to have a timeout on opening a TCP connection, i.e. not
wait forever on opening a connection to a server that is not up.
Is this possible with SDL_net already? I have not found any way to do
it so far.
I have done a few hacks to SDL_net to get this working, i.e. using
fcntl to set O_NONBLOCK for the socket before opening and then
retrying if I get a EINPROGRESS error within a specifed time. It works
on UNIX, but I'm not sure how these things work for windows/mac/etc.
>From my point of view, adding a function like:
would be nice. Since there is no need then to change the open-calls,
thereby providing compability with older versions of SDL_net.
I guess it would also be possible to supply alternative open-calls,
SDLNet_TCP_OpenTimeout(IPAddress *IP, Uint32 msecs);
Would this be interesting?
More information about the SDL