Search code examples
objective-ccocoansurlsessionappkit

How to use specific network connection with NSURLSession (OS X)


Cannot find NSURLSessionConfiguration property to select certain network connection (wired, wi-fi etc.) NSURLSession to work with.

Already got current interfaces list (with ifaddrs struct), now I need to figure out, how to use this data by NSURLSession instance.


Solution

  • I believe the problem you are going to face here is that the OS will only be using one network adapter at one time. So NSURLSession will just use whichever one is active. You would have to somehow manually switch the user's network adapter settings to use Wifi/wired