Exception Running the Sample GameLift Code from AWS

I am using the Sample Multiplayer sample code from AWS GameLift named MegaFrogRace. I followed the instructions from the following URL:

I am using unity editor and Mac OS to run the sample Game. I uploaded the Game Server scripts and configured everything in the backend. But when I try to play the game in Multiplayer using GameLift, I am getting the following exception:

NotImplementedException: The method or operation is not implemented.
at System.Net.NetworkInformation.UnixIPGlobalProperties.GetActiveUdpListeners () [0x00000] in :0
at RTSClient.FindAvailableUDPPort (System.Int32 firstPort, System.Int32 lastPort) [0x00019] in :0
at RTSClient+d__23.MoveNext () [0x000c0] in :0
at UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) [0x00027] in :0
UnityEngine.MonoBehaviour:StartCoroutineManaged2(IEnumerator)
UnityEngine.MonoBehaviour:StartCoroutine(IEnumerator)
RTSClient:ActionConnectToServer(String, Int32, String)
<>c__DisplayClass41_0`3:b__0()
RTSClient:RunMainThreadQueueActions()
RTSClient:Update()

(Filename: Line: 0)

Kindly help me in figuring out the problem. Thanks

Replace the included FindAvailableUDPPort function with this one.

private static readonly IPEndPoint DefaultLoopbackEndpoint = new IPEndPoint(IPAddress.Loopback, port: 0);
private int FindAvailableUDPPort()
{
    using (var socket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp))
    {
        socket.Bind(DefaultLoopbackEndpoint);
        int port = ((IPEndPoint)socket.LocalEndPoint).Port;
        return port;
    }
}

The function in the demo example was only created with Windows in mind. However this one will work for Windows, Mac, iOS, and Android. I’m unsure why they haven’t tested this pull request yet?

2 Likes

@Sky_Copeland Thanks for helping out @sundar_singh

Have reached out to a few folks to try and get the pull request handled.

2 Likes

Thank you so much. I am able to play now.