Skip to content

Network interfaces java API not working in a 64-bit binary #1137

@alexitelman

Description

@alexitelman

Hello,

The following java API is not working when running on a 64-bit device (iPhone 5s) with the arm64 robovm run configuration:

NetworkInterface.getNetworkInterfaces()

This is the error it produces:

java.net.SocketException
    at java.net.NetworkInterface.rethrowAsSocketException(NetworkInterface.java:236)
    at java.net.NetworkInterface.collectIpv4Address(NetworkInterface.java:226)
    at java.net.NetworkInterface.getByName(NetworkInterface.java:145)
    at java.net.NetworkInterface.getNetworkInterfacesList(NetworkInterface.java:331)
    at java.net.NetworkInterface.getNetworkInterfaces(NetworkInterface.java:286)
    at com.mycompany.myapp.MyViewController.getNetworkInterfacesCount(MyViewController.java:35)
    at com.mycompany.myapp.MyViewController.clicked(MyViewController.java:27)
    at com.mycompany.myapp.MyViewController.$cb$clicked(MyViewController.java)
    at org.robovm.apple.uikit.UIApplication.main(Native Method)
    at org.robovm.apple.uikit.UIApplication.main(UIApplication.java:369)
    at com.mycompany.myapp.Main.main(Main.java:17)
Caused by: libcore.io.ErrnoException: ioctl failed: EOPNOTSUPP (Operation not supported on socket)
    at libcore.io.Posix.ioctlInetAddress(Native Method)
    at libcore.io.ForwardingOs.ioctlInetAddress(ForwardingOs.java:83)
    at java.net.NetworkInterface.collectIpv4Address(NetworkInterface.java:204)
    ... 9 more

If running it on the same device with the thumbv7 configuration it works fine (emulated 32-bit on the 64-bit device).

Here's a sample project illustrating the problem:
https://drive.google.com/file/d/0BwxZsZfwfINWYTV4S3NkcjJYWTA/view?usp=sharing

Thanks,
Alex.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions