• 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: Becky Willrich <email@hidden>
  • Date: Mon, 22 Jul 2002 10:13:38 -0700

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.

Incidentally, CFNetwork will do all of this for you - the non-blocking connect and all the HTTP traffic. Take a look at CFHTTPMessage.h and CFHTTPStream.h in CoreServices.framework/Frameworks/CFNetwork.framework/Headers.

REW
_______________________________________________
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.

  • Follow-Ups:
    • Re: Re(2): bsd sockets & http
      • From: Peter Sichel <email@hidden>
References: 
 >Re(2): bsd sockets & http (From: Chaz <email@hidden>)

  • Prev by Date: Re: UDP receiving
  • Next by Date: Re: Re(2): bsd sockets & http
  • Previous by thread: Re(3): bsd sockets & http
  • Next by thread: Re: Re(2): bsd sockets & http
  • Index(es):
    • Date
    • Thread