//Here is some fake code
sendto(masterserver);
recvfrom(masterserver); //Wait 4 seconds before giving up on the responce
sendto(masterserver); // Send agian and so on..
Setting Timeout In a Socket
I am trying to figure out how to set a timeout with a socket. For all you who know sockets you know how bad the mircosoft help
files are.
I don''t know if I even need a "timeout"!? Basicly what I am trying to do is,
Hi Galileo430,
I assume your trying to build reliability into UDP, is this correct?
If so, your going to have to get a little bit more technical in your design to accomplish this.
Try doing a search for reliable UDP or something like that. If all else fails I can send you an outline that I h ave put together, I''m using this to write an article covering this topic.
Game On,
Dave "Dak Lozar" Loeser
I assume your trying to build reliability into UDP, is this correct?
If so, your going to have to get a little bit more technical in your design to accomplish this.
Try doing a search for reliable UDP or something like that. If all else fails I can send you an outline that I h ave put together, I''m using this to write an article covering this topic.
Game On,
Dave "Dak Lozar" Loeser
use select , this function can set a timeout ..
but you may have to re-structure your code a bit.
but you may have to re-structure your code a bit.
I''m using a simple Windows timer. If the timer event occurs - I send a simple packet to test if the connection still exists. The socket should produce an error if the connection doesn''t exist no more.
Can I send a 0 size packet, to test for an existing connection?
Can I send a 0 size packet, to test for an existing connection?
With UDP you can send 0-sized packets. TCP will "optimize" them away...
cu,
Prefect
---
Sanity is the trademark of a weak mind.
cu,
Prefect
---
Sanity is the trademark of a weak mind.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement