× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.




does anybody know why it takes so long for the connect() function to resolve
a wrong IP address? On my system it takes about 5 to 10 minutes!
I understand it somehow relates to the network configuration. Can somebody
point out where to start?

Sounds like you have a firewall that's blocking ICMP datagrams. When the remote host decides not to accept your connection request, it sends back an ICMP message that says "Connection Refused", but you never get it because you're blocking ICMP.

One of the challenges of writing a program that uses network communications is dealing with everything that can go wrong. A firewall may be the problem this time, but next time it may be a bad switch that causes packets to get lost, or the time after that, it may be that someone has cut the network cable.

Please consider using a signal or the select() function to time-out your connection request. That way, it won't matter what's wrong, your program will only get stuck waiting for 30 seconds (or 60, or whatever you set the timeout to.)



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 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.