Knowing when a CFSocket has died
Knowing when a CFSocket has died
- Subject: Knowing when a CFSocket has died
- From: Richard Schreyer <email@hidden>
- Date: Thu, 20 Jun 2002 18:16:00 -0700
I have sockets that sit idle for sometimes significant periods of time.
If that connection is ever broken, I would like the user to get that
feedback.
From my understanding of CFSocket, it issues callbacks when any event
occurs. In the case of a failed connection, it returns a CFDataRef of
length 0. Unfortunately, it doesn't send this callback when the socket
has died while sitting idle, only for example, when a send has been
attempted.
I assume, since the socket doesn't report that it has lost the
connection immediately on a send, it doesn't know that the connection
has been lost yet, and needs to timeout on the send.
Is there some way to get quicker feedback on the socket's state? I
thought about using setsockopt() and the SO_KEEPALIVE option, but the W.
Stevents book says this is usually implemented per-kernel, instead of
per-socket. Does Darwin share this limitation? Also, does anything
know anything about the TCP_KEEPALIVE option that the book very briefly
mentions?
Richard Schreyer
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.