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

Unknown interface for IP Address not 127.0.0.1 #26

Closed
Pinwheeler opened this issue Feb 18, 2020 · 7 comments
Closed

Unknown interface for IP Address not 127.0.0.1 #26

Pinwheeler opened this issue Feb 18, 2020 · 7 comments
Labels
bug Something isn't working iOS

Comments

@Pinwheeler
Copy link

Pinwheeler commented Feb 18, 2020

Description

as in #6 but the discussion around that suggests that it's only for localhost

Steps to reproduce

Steps to reproduce the behavior:

  1. Using iPhone simulator
  2. Connect to an IP address
import TcpSocket from 'react-native-tcp-socket'
this.client = TcpSocket.createConnection({port, host})

Current behavior

The socket fails to connect with error
Unknown interface. Specify valid interface by name (e.g. "en1") or IP address.

Expected behavior

The socket should connect

Relevant information

OS iOS
react-native 0.61.5
react-native-tcp-socket ^3.2.3
@Pinwheeler Pinwheeler added the bug Something isn't working label Feb 18, 2020
@Rapsssito Rapsssito self-assigned this Feb 18, 2020
@Rapsssito
Copy link
Owner

@Pinwheeler, could you provide the host and port you are using to create the connection, please?

@Rapsssito Rapsssito changed the title Unknown interface for IP Address not 127.0.0.1 iOS: Unknown interface for IP Address not 127.0.0.1 Feb 18, 2020
@Rapsssito Rapsssito added the iOS label Feb 18, 2020
@Rapsssito Rapsssito changed the title iOS: Unknown interface for IP Address not 127.0.0.1 Unknown interface for IP Address not 127.0.0.1 Feb 18, 2020
@Pinwheeler
Copy link
Author

Here's my logging info around it.

 LOG  <Socket port: 9876 host: 167.99.166.69>
 LOG  [Socket - ERROR:: Unknown interface. Specify valid interface by name (e.g. "en1") or IP address.]

Ah... is this because that IP address is IPv6? Dang- do you know how to convert them?

@Rapsssito
Copy link
Owner

167.99.166.69 is an IPv4 address. There should not be an issue with that.

Ah... is this because that IP address is IPv6? Dang- do you know how to convert them?

You can't convert all IPv6 addresses to IPv4 - there are more IPv6 addresses than there are IPv4 addresses.

@Rapsssito
Copy link
Owner

Rapsssito commented Feb 18, 2020

@Pinwheeler, it is indeed a bug with the localAddress handling on the iOS part when connecting without specifying one. Thanks for the feedback! I will update when a fix is ready.

@Rapsssito
Copy link
Owner

@Pinwheeler, I have released a fix version (3.2.7). Could you please test if the issue persists using that version?

@Pinwheeler
Copy link
Author

Checked using the latest version and the issue is resolved. Thanks again!

@Rapsssito
Copy link
Owner

Glad it worked!

@Rapsssito Rapsssito removed their assignment Aug 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working iOS
Projects
None yet
Development

No branches or pull requests

2 participants