Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error code: -9980(0x-26FC), No route to host #198

Open
cHicHillo opened this issue Nov 30, 2020 · 12 comments
Open

Error code: -9980(0x-26FC), No route to host #198

cHicHillo opened this issue Nov 30, 2020 · 12 comments

Comments

@cHicHillo
Copy link

After finishing integrating your framework in my project, when testing this on physical devices, it doesn't work. I have added all the privacy guidelines in the info.plist. I received this error (Only in physical devices):

▿ Error code: -9980(0x-26FC), No route to host

  • domain : "com.ibm.oss.Socket.ErrorDomain"
  • errorCode : -9980
    ▿ errorReason : Optional
    • some : "No route to host"
  • bufferSizeNeeded : 0
@dannys42
Copy link
Contributor

dannys42 commented Dec 6, 2020

Hi @cHicHillo just to confirm, does this happen regardless of destination? (different domains and http/https?)

@devmkdd
Copy link

devmkdd commented Dec 27, 2020

Hi @dannys42 ,

I'm currently facing the same error message as above but I'm not sure if this is on your side. Maybe you have a hint.

I've implemented a really small library for running ssdp searches as swift package and this is used within an iOS application.
https://github.com/devmkdd/TinySSDP
For doing the search I use BlueSocket, which is also entered as dependency within the swift package.

Within the iOS App I've linked this library via spm and on simulator everything works fine. When I run the project on an iOS14 device and search for devices via ssdp, I get the error above. Also after granting the Local Network Permission.

The interesting part now for me is the following case. I've copied the library code into the iOS app project and referenced BlueSocket via CocoaPods. And now everything works fine. So maybe the Local networking Permission is not working for Dependencies? Do you have any observations in such a direction? It also does not make any difference if I reference via SPM or CocoaPods within the iOS app.

Edit:
I've tried the same setup from SPM as with CocoaPods and the error is the same. So everytime I include BlueSocket as a dependency of a dependency it does not work. When I use it as direct app dependency it works.

Working Setups:

  • App include code from TinySSDP directly

  • Reference BlueSocket via CocoaPods

  • App include code from TinySSDP directly

  • Reference BlueSocket via SPM

Failing Setups:

  • App references TinySSDP via SPM

  • TinySSDP references BlueSocket via SPM

  • App references TinySSDP via CocoaPods

  • TinySSDP references BlueSocket via Podspec

@devmkdd
Copy link

devmkdd commented Dec 28, 2020

@dannys42 I could test to the switch of the deployment target.
If I set the apps deployment target to iOS12, I can no longer connect. Until 11.4 everything works fine. Is this related to the introduction of the iOS Network Framework with iOS 12?

@dannys42
Copy link
Contributor

@devmkdd I tried taking a look at TinySSDP, but I don't quite see how to run it. Do you have another sample program I can test with? If not, I'll see if I can put one together later this week.

@devmkdd
Copy link

devmkdd commented Dec 29, 2020

@devmkdd I tried taking a look at TinySSDP, but I don't quite see how to run it. Do you have another sample program I can test with? If not, I'll see if I can put one together later this week.

Hey @dannys42,
i've put together a small example at Github:
https://github.com/devmkdd/SSDP-test

It integrates my lib which references BlueSocket in version 1.0.52. Just changing the deployment target to iOS 12 leads to the described error when deploying to a real device. I've tested on an iPhone 8 running iOS14.3 and Xcode 12.3. (First tests were Xcode 12.0 and iOS 14.0).

@dannys42
Copy link
Contributor

dannys42 commented Jan 2, 2021

Hi @devmkdd, thanks for the example program, it really helped. I found a discussion on the Apple forums that suggests there might be two potential issues:

  1. The interface may need to be bound for the broadcast
  2. You may need the to request multicast entitlement to Apple

Considering this worked in prior versions of iOS, I doubt #1 is necessary. It really sounds like #2 is at issue. I don't know why simply targeting iOS 11 does not trigger the behavior. But as I have an iOS 14 device as well, I cannot verify whether this error shows up in prior versions of iOS.

Submitting a request looks like a manual process, so I did not test it. Please submit a request with Apple and keep us updated if this fixes your issue.

@squarefrog
Copy link

Hi all. I have the same issue, with a different socket library (I'm also doing SSDP searches).

I'm running a test with BlueSocket, and I think I can work around this by using BlueSocket. One thing to note, after connecting to the multicast group for SSDP (239.255.255.250:1900), the first message will ALWAYS fail with "no route to host". This also fails when using CFNetwork directly.

If you keep the socket open after that first error, and send your message again, you should find it works fine.

Scouring the dev forums, there are a few threads that may be of interest. A frameworks engineer on there suggested that the multicast entitlement is worth applying for, however it is not yet required. They ideally want iOS 14 users to move over to Network.framework, but they have no intention (yet..) of breaking BSD sockets.

Some more information from my project findings:

  1. I encountered this only on iOS 14, and only after increasing my deployent target to iOS 12 or higher.
  2. Additionally, I only found this behaviour when updating to Xcode 12. Xcode 11 seemed fine.

@lazlox
Copy link

lazlox commented Jan 27, 2021

I had the same issue on physical devices and requesting and adding the multicast entitlement resolved the issue. Took a couple of days to get it after the request.

@squarefrog
Copy link

My understanding is this isn't a requirement yet; outside of the Network.framework. However, this is likely to change, so it's better to be prepared.

Your first hand account of it fixing the issue is promising though, I'll apply for it now.

@devmkdd
Copy link

devmkdd commented May 29, 2021

I had the same issue on physical devices and requesting and adding the multicast entitlement resolved the issue. Took a couple of days to get it after the request.

Requesting the entitlement did also work for me now.

@kelada
Copy link

kelada commented Jun 15, 2021

I am using BlueSocketvia https://github.com/pierrickrouxel/SSDPClient and have run into the same issue.

Rather than requesting the entitlement other have mentioned above, I opted to switch back to Xcode 12.4 - this has worked for me. Both Xcode 12.5 & 13 beta throw this error when running on a physical device.

Note: I don't know if this will be an issue when submitting to app store down the line, but for development purposes it's good enough for me. YMMV.

@squarefrog
Copy link

@kelada it will be an issue. It affected us in production. Request the entitlement now. It’s quick and easy and you only need to request it once, then you can use the entitlement across as many apps as you want, providing they are under the same team name.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants