• 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
socket connect fails with "network unreachable" but NSURLSession succeeds
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

socket connect fails with "network unreachable" but NSURLSession succeeds


  • Subject: socket connect fails with "network unreachable" but NSURLSession succeeds
  • From: Imran Patel <email@hidden>
  • Date: Thu, 07 May 2015 10:08:23 -0700

Hi,

I am getting a ENETUNREACH error when trying to connect a socket via
the GCDAsyncSocket library:
Error Domain=NSPOSIXErrorDomain Code=51 "Network is unreachable"
UserInfo=0x15e802c0 {NSLocalizedFailureReason=Error in connect()
function, NSLocalizedDescription=Network is unreachable}

The socket connection is for a custom protocol. However, HTTP requests
via NSURLSession are succeeding over the cellular interface around the
same time. I know that network connectivity changed before the connect
failures started - prior HTTP requests used to go over the wifi
connection. My guess is that iOS is somehow trying to use the bad wifi
interface for the socket connection whereas HTTP connections are going
over cellular. Is that likely? If so how do I detect such situations
and go over the cellular interface?

I have read that using the POSIX socket API directly might not wake up
an inactive cellular interface but in this case the HTTP requests
should be keeping it active, right?

Thanks
Imran
 _______________________________________________
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


  • Prev by Date: NSURLSession memory leak
  • Next by Date: Re: Known problems with calling [NSURLSessionDataTask cancel]?
  • Previous by thread: NSURLSession memory leak
  • Next by thread: Re: Known problems with calling [NSURLSessionDataTask cancel]?
  • Index(es):
    • Date
    • Thread