2
votes

Is it possible using Objective C in Mac OS to determine the type of active network connection (Wifi or LAN)?

I referred Reachability example code in Apple Library (https://developer.apple.com/library/IOs/samplecode/Reachability/Introduction/Intro.html) but was unable to get any information to detect LAN network type on Mac OS.

Please help me on this.

Thanks.

1
check your interfaces and routing table, then all you have to figure out is which GW you are going to use (in most cases it will be the one set as default for 0.0.0.0)Tymoteusz Paul
Have a look at developer.apple.com/library/mac/documentation/networking/… in particular SCNetworkInterfaceCopyAll This should guide you to getting the interfaces. You will then need to work out the service order. SCNetworkSetGetServiceOrdermarkhunte

1 Answers

0
votes

Have a look at Reachability implementation https://developer.apple.com/library/ios/samplecode/Reachability/Introduction/Intro.html

I'm not sure about LAN however you can find out, if its connected to Wifi and internet is available or not.

I guess this might help you.