Re: CFReadStream and iPhone
Re: CFReadStream and iPhone
- Subject: Re: CFReadStream and iPhone
- From: Jens Alfke <email@hidden>
- Date: Wed, 18 Feb 2009 08:59:06 -0800
On Feb 18, 2009, at 7:35 AM, John Michael Zorko wrote:
once connectivity is established and the CFReadStream is created, I
don't get any errors back from the CFReadStream when the network
changes (and I would think I would i.e. the connection would be
dropped, right)?
Nope. The socket won't be disconnected until/unless it sends packets
and doesn't receive ACKs for them, or it times out through lack of
activity (something like 2 hours.)
TCP is designed to be tolerant to temporary network interruptions, so
even if an interface goes down, sockets will stay alive waiting for a
route to reappear to the destination.
For example, if you're on Ethernet you can unplug the cable, wait ten
seconds or so, and then plug it back in without interrupting sockets.
However, applications like Mail and iChat will notice that the
interface is down and decide to pro-actively close their sockets, as
part of their mobility support. Your app can do likewise, by
registering for reachability notifications for the destination IP
address, and disconnecting if notified that it's unreachable.
—Jens
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden