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

nodename nor servname provided, or not known #129

Closed
shinma opened this issue Apr 9, 2018 · 8 comments
Closed

nodename nor servname provided, or not known #129

shinma opened this issue Apr 9, 2018 · 8 comments

Comments

@shinma
Copy link

shinma commented Apr 9, 2018

iOS: 11.3
Xcode: 9.3

When: on executing connect(to host: String, port: Int32, timeout: UInt = default) on Socket
Possible cause: getaddrinfo()

@shinma
Copy link
Author

shinma commented Apr 9, 2018

.create(family: .inet6, type: .stream, proto: .tcp)

@shinma shinma closed this as completed Apr 9, 2018
@shinma
Copy link
Author

shinma commented Apr 9, 2018

Even though I'm not using IP address it shouldn't work like this. What if provider switches to IPv6 in the meantime.

@shinma shinma reopened this Apr 9, 2018
@billabt
Copy link
Collaborator

billabt commented Apr 9, 2018

I've made a change to the signature of the connect() function that corrects the problems but also allows for the caller to specify that only a socket of the family of the calling Socket will be allowed. The default is to allow connection to a socket of any family. This change will be in the latest version, 1.0.2, as soon as I get it posted. Thanks.

@billabt billabt closed this as completed Apr 9, 2018
@davidjaystrauss
Copy link

What was the fix on this? I'm still having this error occur on socket create in 1.0.46

@billabt
Copy link
Collaborator

billabt commented Apr 23, 2019

@davidjaystrauss What error are you getting? Can you give me an example of the code? Thanks.

@davidjaystrauss
Copy link

davidjaystrauss commented Apr 23, 2019

Hi @billabt, definitely!

We aren't specifying anything to the create method, as we're using this in parallel with BlueSSLService.

So for create we just call try Socket.create() and get Error code: -9989(0x-2705), nodename nor servname provided, or not known

This doesn't happen every time, seems to be random at the moment when it's occurring.. sorry trying to get some more data for you

@davidjaystrauss
Copy link

Some more info:

After creation we specify host/port with try socket.connect(to: self.config.getProxyHost(), port: Int32(self.config.getProxyPort()))

@billabt
Copy link
Collaborator

billabt commented Apr 24, 2019

What is the value being returned by self.config.getProxyHost()? The error you're getting indicates a getaddrinfo() failure... This typically means that the hostname provided is an empty string.

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

3 participants