Is there any way to cancel a SDLNet_TCP_Recv
call after some time when no answer arrives? Or are there alternatives to this function that support a timeout option?
Create a socket set with SDLNet_AllocSocketSet()
& add your TCPsocket
to it with SDLNet_AddSocket()
. Then you can use SDLNet_CheckSockets()
with a timeout to wait for network activity.
Depending on the return-value you can then use SDLNet_SocketReady()
to verify that the SDLNet_TCP_Recv()
call won't block.