• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: How to prevent a POSIX socket from using a cellular connection?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to prevent a POSIX socket from using a cellular connection?


  • Subject: Re: How to prevent a POSIX socket from using a cellular connection?
  • From: Josh Graessley <email@hidden>
  • Date: Mon, 08 Dec 2014 13:54:41 -0800

The socket option to set that restriction is not public. If you are trying to avoid any cellular traffic, you would also need a way to avoid sending DNS over cellular. That functionality is also not public.

I did notice the following documentation on developer.apple.com:
https://developer.apple.com/library/ios/documentation/CoreFoundation/Reference/CFSocketStreamRef/index.html

If you can use a CFSocketStream to establish the connection, you could use kCFStreamPropertySocketNativeHandle to fetch the file descriptor out. POSIX/BSD socket APIs won’t trigger cellular to dial or VPNs to come up among other problems.

-josh

> On Dec 8, 2014, at 1:33 PM, Jens Alfke <email@hidden> wrote:
>
> I need to (optionally) prevent a TCP socket from being opened over a cellular connection. The Apple docs describe how to do this when using NSURLConnection or CFStream APIs, but the code in question uses the POSIX/BSD socket API. (Not my choice; I'm using GCDAsyncSocket and that's how it works.)
>
> Is there some setsockopt mode, equivalent to kCFStreamPropertyNoCellular, to disable cellular networking? I couldn't find it in the man page.
>
> —Jens
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Macnetworkprog mailing list      (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


  • Follow-Ups:
    • Re: How to prevent a POSIX socket from using a cellular connection?
      • From: Jens Alfke <email@hidden>
References: 
 >How to prevent a POSIX socket from using a cellular connection? (From: Jens Alfke <email@hidden>)

  • Prev by Date: How to prevent a POSIX socket from using a cellular connection?
  • Next by Date: Re: How to prevent a POSIX socket from using a cellular connection?
  • Previous by thread: How to prevent a POSIX socket from using a cellular connection?
  • Next by thread: Re: How to prevent a POSIX socket from using a cellular connection?
  • Index(es):
    • Date
    • Thread