Re: Rescuing a TCP socket after interface down
Re: Rescuing a TCP socket after interface down
- Subject: Re: Rescuing a TCP socket after interface down
- From: "Quinn \"The Eskimo!\"" <email@hidden>
- Date: Mon, 22 Nov 2010 09:56:29 +0000
On 20 Nov 2010, at 23:15, Sidney San Martín wrote:
> It looks like AsyncSocket works by setting a callback on the read stream with CFReadStreamSetClient, and considers the connection closed when it gets called back with a kCFStreamEventEndEncountered event. This happens as soon as the interface goes down. Based on the docs, I think that the socket is useless after this point. I'm no CFSocket guru. How can the application be changed to deal with this condition more nicely?
I don't think it can while continuing to use CFStream (not CFSocket btw). CFSocketStream automatically monitors the source address of the stream and, if it goes away, immediately closes the stream. There's no public API to disable that check, or change its policy (for example, to institute a delay). Which is kinda annoying. It would be nice if CFSocketStream had a public API where you could tell it "I know what I'm doing, don't try to be clever."
Please file a bug against CFSocketStream describing your situation and the way you'd like to see it improve.
<http://developer.apple.com/bugreporter/>
S+E
--
Quinn "The Eskimo!" <http://www.apple.com/developer/>
Apple Developer Relations, Developer Technical Support, Core OS/Hardware
_______________________________________________
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