ntl0ve
ntl0ve

Reputation: 1986

OS X, Cocoa: how can an app be signaled when a network connection becomes available?

I just noticed that Textual neatly reconnects me back to any IRC servers I have configured as soon as a network connection becomes available.

How can an application be signaled that a connection is up and running? I'm half-guessing/half-hoping the client isn't forced to constantly poll and is able to receive a signal/event instead.

How is it done?

Upvotes: 1

Views: 90

Answers (1)

Adam Roben
Adam Roben

Reputation: 784

You can use the SCNetworkReachability class for this.

Upvotes: 2

Related Questions