Need to route Data traffic.

HI Guyz,

In general if user use cellular data and if wifi is enabled than data will transmit to WIFI ( because its higher priority ). Its os terminology but i want to provide alert here for user which network user want to use than. Like if user want to use Cellular than all data traffice will work with cellular only even if wifi is enaled.

I tried to find lots of things but not getting proper answer.

Replies

I am not sure I do understand your question completely, but if you developing software and want to send your traffic through particular interface then setsockopt with IP_BOUND_IF might help.

I used it to route some traffic bypassing VPN on Mac OS X


http://lists.apple.com/archives/darwin-dev/2014/Jan/msg00004.html


int idx = if_nametoindex( "en1");
setsockopt(s, IPPROTO_TCP, IP_BOUND_IF, &idx, sizeof(idx) );

And of cause, questions like your will get more answers if asked in more appropriate forums, like "Core OS/Networking"

https://forums.developer.apple.com/community/core-os/networking

Rum wrote:

And of cause, questions like your will get more answers if asked in more appropriate forums, like "Core OS/Networking"

Indeed. I've just gone ahead and moved the thread there.

bimal13 wrote:

Like if user want to use Cellular than all data traffice will work with cellular only even if wifi is enaled.

Are you trying to affect the traffic of just your app? Or all apps on the system?

Share and Enjoy

Quinn "The Eskimo!"
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"