|
The amount of time it takes to complete the connect() function depends on network performance and whether the connection attempt succeeds. Unfortunately, in blocking mode, you don't have any control of how long the connect could take. Here is a fairly novel result that came up in google (unfortunately in C): http://mail.gnome.org/archives/gnome-components-list/1999-August/msg00038.html Even though this code uses select coded in a 'forever' type loop, the select will block for up to the timeout seconds, but will return if the connection happens (before the timeout) by the socket becoming writable. Not a terrible CPU hog, and as responsive as possible. Regards, Rich At 03:37 PM 3/4/02, you wrote: >Folks: > >Does anyone know if it's possible to set a timeout on a TCP/IP connect? > >My research indicates that there is no easy way to do this ... I found >http://www.developerweb.net/sock-faq/detail.php?id=36 which talks about >setting the socket into non-blocking mode, which I really don't want to do >at this point (it would change my applications structure more than I'm >willing to deal with now). > >Thanks! > >david
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.