On 16 Jan 2018, at 08:48, Carl Hoefs <newsli...@autonomy.caltech.edu> wrote:

> Yes, the server is available on the internet, 24/7, and has an associated DNS 
> name.

Cool.  That leaves a bunch of other possibilities.  The first thing I’d check 
is your support for IPv6-only DNS64/NAT64 networks.  Earlier you wrote:

> gethostbyname(3) call returns a populated hostent struct

The fact you’re using a legacy API like this implies that you’re not 
IPv6-compatible.  To can learn more about this is my “Supporting IPv6-only 
Networks” pinned post on DevForums.

<https://forums.developer.apple.com/message/136166#136166>

IMPORTANT: You need to fix this even if it’s not the cause of this specific 
problem.  You can test your fix by setting up MacNAT64, per FAQ#1 in the 
above-mentioned post.

> On the iPhone, under Settings —> Cellular, the app shows enabled (green) …


Cool.  You can verify that this is working as expected by adding a simple test 
to your app that uses a high-level API for your networking.  For example, the 
code pasted in below should successfully fetch data over both Wi-Fi and WWAN.  
If you put it in your app and it works over Wi-Fi but fails over WWAN, you know 
that something weird is going on with network interface access control.

On the other hand, if this works over both Wi-Fi and WWAN but your BSD Sockets 
code fails on WWAN, you know the problem is with your code.

Share and Enjoy
--
Quinn "The Eskimo!"                    <http://www.apple.com/developer/>
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

---------------------------------------------------------------------------
let url = URL(string: "https://www.apple.com";)!
let request = URLRequest(url: url, cachePolicy: .reloadIgnoringLocalCacheData, 
timeoutInterval: 60.0)
URLSession.shared.dataTask(with: request) { (data, response, error) in
    if let error = error as NSError? {
        NSLog("task transport error %@ / %d", error.domain, error.code)
        return
    }
    let response = response as! HTTPURLResponse
    let data = data!
    NSLog("task finished with status %d, bytes %d", response.statusCode, 
data.count)
}.resume()
---------------------------------------------------------------------------

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list      (Macnetworkprog@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/macnetworkprog/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to