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

Method LANScanner.startScan() gets error 101 due of different network environment #6

Closed
mxd4n13l0n opened this issue May 9, 2017 · 1 comment

Comments

@mxd4n13l0n
Copy link

When trying to integrate the LanScanner pod on a iPad Air 2 simulator I get the error code 101.
Trying to debug the problem I found that the method getLocalAddress() returns nil. Taking a look in the code it seems that the while loop that is looking for the "en0" string on the interface name are not matched. That error was triggered because I might be using an external network card.

What if it could be changed to the following:

  let name = String(cString:interface.ifa_name)
  if name..range(of:"en") != nil {
     //...
}

Would be glad if you allow me to do a pull request.

Regards,

@pushchris
Copy link
Contributor

Feel free to submit a pull request

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

2 participants