Archived

This topic is now archived and is closed to further replies.

darwintn

connect() timeout

Recommended Posts

darwintn    122
I am using TCP. When a client wants to search for server games, he tries to connect to all IPs of the LAN, using the connect() function. However, this function waits for the response od the server, but if the server doesn''t have a game created, the connect() function become too slow. I wanted to know if there''s a way to set the timeout to the connect() function, or if there''s another way to search for games created on the LAN.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster   
Guest Anonymous Poster
send a SYN packet to all the ips and just listen. if any ACKS come back, you can connect to their origins.

Share this post


Link to post
Share on other sites
darwintn    122
or how can I send broadcasting packets without connecting to the destiny??? or I don''t need to connect to the destiny to send broadcasting packets?

Share this post


Link to post
Share on other sites