• 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
Re: Detecting cable unplug/Network failure
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Detecting cable unplug/Network failure


  • Subject: Re: Detecting cable unplug/Network failure
  • From: Jens Alfke <email@hidden>
  • Date: Mon, 2 Mar 2009 11:22:25 -0800


On Mar 2, 2009, at 9:27 AM, David García wrote:

I'm quite new in Mac programming, and I've found some problems where I got stuck in the network. The matter is that, I need to know when there's a physical network error (most immediate cable being unplugged).

The SystemConfiguration framework will let you register for various notifications. The one you probably want is for when the "reachability" of a specific IP address changes. I don't remember the name of the function, but it's pretty clear which one it is (and there is sample code for it.)


When I perform writes to the socket, the OS seems to take bytes without problem (saving them into internal buffers I imagine), but doesn't return an error.

This is by design. TCP is resilient to temporary connectivity problems, and will buffer up data and attempt to resend it several times before giving up. This is useful if your 3G connection goes down for a few seconds, or your DSL modem has to resync, or you have to swap out an Ethernet cable to a server, etc.


—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

References: 
 >Detecting cable unplug/Network failure (From: David García <email@hidden>)

  • Prev by Date: Re: Detecting cable unplug/Network failure
  • Next by Date: Re: Detecting cable unplug/Network failure
  • Previous by thread: Re: Detecting cable unplug/Network failure
  • Next by thread: Five Reasons Why Synchronous Networking Is Bad
  • Index(es):
    • Date
    • Thread