Search Unity

  1. We have added dedicated sub-forums for UNet, the experimental MLAPI and Unity Transport Package. Please use the new forums to discuss related topics.
    Dismiss Notice
  2. How can our website serve you better? Give us your feedback. Take our survey and let us know.
    Dismiss Notice

Help Wanted Unity Transport : Failed to initialize the Network Interface. Error Code -1.

Discussion in 'Unity Transport' started by Kartikaeya, May 4, 2021.

  1. Kartikaeya

    Kartikaeya

    Joined:
    Jan 3, 2021
    Posts:
    7
    So I'm making a mobile VR game where the user will put on some google cardboard like device and would control the character movement through the keyboard on a laptop/computer which is on the same wifi network as the mobile.

    The way this is set up is that I have two different scenes, the controller scene(client) which runs on the computer and the scene containing the actual game(server) which runs on the mobile device in VR. Whenever there is a keyboard event on the computer the controller scene sends a network message to the main game scene on the mobile device, thus controlling the character movements.

    To send these network messages I've used the Unity transport package, and have used almost the exact script available here.
    The game runs fine when I build both the controller and the game (client & server) on pc i.e I'm able to control the character in the game scene from the controller scene. But it fails when either of the client or the server is built to the mobile device. I get these two errors on the mobile device :

    1. InvalidOperationException: Failed to initialize the NetworkInterface. Error Code: -1.
    2. Error on receive, errorCode = 16777219

    I am new to networking (and unity in general) so I'm sorry for taking your time if this turns out to be a noob mistake.
    Thanks a lot for your help in advance!
     
  2. justin_sunblink

    justin_sunblink

    Joined:
    Dec 3, 2019
    Posts:
    10
    I have run into this error when attempting to bind my server to a public IP address assigned by AWS GameLift. When I switched to using the `AnyIpv4` endpoint type, things started working.
     
    Kartikaeya and luke-unity like this.
  3. Kartikaeya

    Kartikaeya

    Joined:
    Jan 3, 2021
    Posts:
    7
unityunity