Click to See Complete Forum and Search --> : How can I reduce the timeout of function Connect(...)?


petranca
December 17th, 2004, 05:00 AM
Hi guys, I have a program that connects to some ip's. But sometimes, those ip's are not available. So, as far as I know, Connect(...) attempt to connect at 3, 6, and 12 seconds, that makes a total of 21 seconds before I get the timeout.

My question is, how can I reduce this timeout? I say that because I only have one process, and the overall behaviour of the application is affected by this timeout.

thanks in advance

NoHero
December 17th, 2004, 06:10 AM
By looking at the following FAQ (http://www.codeguru.com/forum/showthread.php?t=312668) :cool:

/ Wow I am feeling like Andreas Masur :thumb:

kuphryn
December 17th, 2004, 01:08 PM
Check out setsockopt(). Consider a non-blcoking socket.

Kuphryn

petranca
December 20th, 2004, 05:47 AM
thanks guys.... i'll use the select function.