views:

24

answers:

1

Is there any way to be notified / have your Cocoa application listen for changes in the network connection (disconnect, connect, etc.)? How does something like HardwareGrowler do it?

A: 

After looking at the source code for HardwareGrowler (found under /Extras in the source code for Growl, I figure that the easiest way would be to use the NetworkNotifier.m class and change all calls to AppDelegate functions to whatever callbacks you want executed when the network connection changes (and give them credit for their code!).

Chetan