Re: Re(2): bsd sockets & http
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.