• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Re(2): bsd sockets & http
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Re(2): bsd sockets & http


  • Subject: Re: Re(2): bsd sockets & http
  • From: Peter Sichel <email@hidden>
  • Date: Mon, 22 Jul 2002 14:04:04 -0400

At 10:13 AM -0700 7/22/02, Becky Willrich wrote:
I have another question about the behavior of sockets, though. When I try to connect() to a host that doesn't exist, connect() will return an error after one or two minutes, while the beach ball spins. Is there a way to shorten that time?

Sadly, no; the actual timeout is (I think) 75 seconds, and you cannot get the connect to timeout before that. You can call the connect non-blocking, then poll the socket for writability (simply closing it if you don't want to wait any longer); that's your best option, but now you won't block in connect() at all.

You don't literally need to poll, use select instead. Stevens Unix
Network Programming has an example showing how to connect with time out.

- Peter
_______________________________________________
macnetworkprog mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/macnetworkprog
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: Re(2): bsd sockets & http (From: Becky Willrich <email@hidden>)

  • Prev by Date: Re: Re(2): bsd sockets & http
  • Next by Date: Requesting use of NULL MODEM script from a USB modem
  • Previous by thread: Re: Re(2): bsd sockets & http
  • Next by thread: how to work with proxy server
  • Index(es):
    • Date
    • Thread