Is there a way to force LLAPI use TCP?

Hi, i am writing a online game based on C/S model, the client is written in Unity3D of course. But the server is written in go language(golang.com). I hope the game client can be running cross-platform in browser-WebGL, pc/mac standalone etc, it’s easy with Unity.

Since WebGL do not support UDP, so i only implemented TCP code in my server. I hope the client always use TCP to connect to the server, code like below:

        byte error;
        config = new ConnectionConfig();
        channelId = config.AddChannel(QosType.ReliableSequenced);
        hostTopology = new HostTopology(config, 1);
        hostId = NetworkTransport.AddHost(hostTopology, port);
       
        connectionId = NetworkTransport.Connect(hostId, host, port, 0, out error);

When i build and Run it with WebGL, the server get connected. But when i run it in Unity Editor, the server can not get connected, i guess it is because UDP is used by default in Editor/standalone version, right?

So, there is the question, can i force the NetworkTransport to use only TCP connection?
Thanks!

1 Like

I too would like to know this.