Bolt and Amazon AWS

Hi all,

i tried to run a Bolt server on a Amazon AWS EC2 machine but i can't reach the server by client on my local machine.

I put the EC2 machine in "all traffic"" security group:

https://imgur.com/a/Yn61D
https://imgur.com/a/9bnSX
https://imgur.com/a/jTpRt

Inbound and outbound rule: Protocol All, Port Range All, Source 0.0.0.0/0 and ::/0

Also i add 4 rules to windows firewall to accept all program in all port inbound and outbound

https://imgur.com/a/upoQf
https://imgur.com/a/m5wnu

The application is based on tutorial and the code is very simple:

void OnGUI()
{
GUILayout.BeginArea(new Rect(10, 10, Screen.width - 20, Screen.height - 20));

if (GUILayout.Button("Start Server", GUILayout.ExpandWidth(true), GUILayout.ExpandHeight(true)))
{
// START SERVER
BoltLauncher.StartServer(UdpKit.UdpEndPoint.Parse("IP:27000"));
}

if (GUILayout.Button("Start Client", GUILayout.ExpandWidth(true), GUILayout.ExpandHeight(true)))
{
// START CLIENT
BoltLauncher.StartClient();
}

GUILayout.EndArea();
}

public override void BoltStartDone()
{
if (BoltNetwork.isServer)
BoltNetwork.LoadScene("test");
else BoltNetwork.Connect(UdpKit.UdpEndPoint.Parse("IP:27000"));

}



I tried to put the Public IP on the StartServer function but i get this error:

Could not bind physical socket, platform error: 10049: AddressNotAvaible

If i put the private IP or "127.0.0.1" i can launch the server but if i launch a client on my computer, with Public IP of EC2 machine ont the "Connect" function, i can't connect to server ( i get "retrying connect..." ).

The same application works well over LAN with the private IP on both server and client (or 127.0.0.1 on the server).

What am I doing wrong?

Thanks!

Comments

  • That means the IP address doesn't exist on the networking interface. Try this




    string gameServerAddress = GetGameServerAddress();
    ushort port = GetGameServerPort()
    UdpIPv4Address ip = UdpIPv4Address.Parse("127.0.0.1");
    if(IsLocalIpAddress(gameServerAddress))
    {
    ip = UdpIPv4Address.Parse(gameServerAddress);
    }
    UdpEndPoint endpoint = new UdpEndpoint(ip, port);
    BoltLauncher.StartServer(endpoint);
  • Hi stanchion,
    thanks for your reply!

    Unfortunately i can't find "GetGameServerAddress", "GetGameServerPort" and "IsLocalIpAddress" functions: what "using" have i to add?

    Also, if it is possibile, can you explain to me what this piece of code do? what's difference from the "standard" code?

    Thanks a lot!
  • The first 2 just return an address and a port. Other one see here http://www.csharp-examples.net/local-ip/
  • I'm so sorry but i don't understand.

    GetGameServerAddress return an address: EC2 public IP, EC2 private IP or what?
    GetGameServerPort return port: 27000 can be right?

    Thanks again!
  • The address needs to be one that exists on the networking interface an the port needs to be open.
  • Ok now it's more clear but, how can i discover an address that exists on the networking interface? and how can i be sure that a port is open?

    Thanks again!
  • That's outside the scope of Bolt really, if you can bind a .NET socket to that address and port then so can Bolt.
  • Hi Stanchion,

    i gone deeply with my test and i built a simple java server

    public ServerSocket server=new ServerSocket(27000);

    and a simple c# client (inside a Unity project)

    TcpClient client = new TcpClient(ip, port); //server
    StreamReader input = new StreamReader(client.GetStream(), Encoding.UTF8);
    StreamWriter output = new StreamWriter(client.GetStream());


    and all works well, i can connect from any machine to my server.
    At this point i think there is an issue with Bolt, because my test proves that EC2 machine doesn't have any restriction on the port or any firewall restriction.

    Can you help me to use Bolt plugin?

    Thanks!
  • No one can help me?

    i think should be a very simple thing because Bolt is used in published games and probably is my fault, but i don't understand what's wrong.

    Thanks!