• 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
Knowing when a CFSocket has died
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Prev by Date: Re: [Q] large flat files usage
  • Next by Date: Re: Converting a NSString into a math opertation
  • Previous by thread: controlling scrollbar position
  • Next by thread: Re: Knowing when a CFSocket has died
  • Index(es):
    • Date
    • Thread