Search Unity

NetworkTransport.ConnectAsNetworkHost in NAT64 network - not ConnectEvent

Discussion in 'Multiplayer' started by Alexey_, Oct 15, 2018.

  1. Alexey_

    Alexey_

    Joined:
    Sep 4, 2014
    Posts:
    2
    Good day!

    When publishing to the app store on the game there was a failure due to the fact that it does not work in the ipv6 networks.
    Set up wifi using internet sharing nat64 network in mac.

    First, I get ip using CreateMatch, ip always comes in ipv4 format. Next I call
    NetworkTransport.ConnectAsNetworkHost

    eg
    ConnectAsNetworkHost m_HostId: 0 relayIp: 52.29.208.212 relayPort: 9999 networkId: 450359962750507214 Utility.GetSourceID (): 1872064047 nodeId: 26625
    getaddrinfo: nodename nor servname provided, (this message is on both ipv4 and ipv6 networks)

    When on an ipv4 network, I soon get ConnectEvent.
    If the network is ipv6 then I do not get ConnectEvent.

    Please tell me what could be the matter?
     
  2. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    Your relayIp doesn't look like a IPv6 IP, maybe that's the problem.
    Or maybe you found a bug, in which case it might be worth reporting it.
     
  3. Alexey_

    Alexey_

    Joined:
    Sep 4, 2014
    Posts:
    2
    Such a relay ip method returns

    m_NetworkMatch.CreateMatch (room, 2, true, "", "", "", 0, 0, OnMatchCreate);
    ->
    void OnMatchCreate (bool success, string extendedInfo, MatchInfo matchInfo)
    ..
    matchInfo.address is ipv4 in my wifi NAT64 network ( details https://developer.apple.com/library...standingandPreparingfortheIPv6Transition.html)

    I do not know how it should be.
    I tried to translate it into the ipv6 format by adding the prefix but it did not help.

    More if you look at sdk https://docs.unity3d.com/ScriptReference/Networking.NetworkTransport.ConnectAsNetworkHost.html you can see the following:

    public static void ConnectAsNetworkHost (int hostId, string address, int port, Networking.Types.NetworkID network, Networking.Types.SourceID source, Networking.Types.NodeID node, out byte error);

    Parameters
    ...
    address - IPv4 address of the relay.

    It is not clear why only ipv4?
    After all, in theory, Unity fully supports ipv6
    (https://blogs.unity3d.com/2016/05/10/unity-and-ipv6-support/)
     
    Last edited: Oct 16, 2018