socket connect fails with "network unreachable" but NSURLSession succeeds
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 (Macnetworkprog@lists.apple.com) Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/macnetworkprog/site_archiver%40lists... This email sent to site_archiver@lists.apple.com
participants (1)
-
Imran Patel