#StartConnection

25 messages · Page 1 of 1 (latest)

late moss
#

Depends on the transport, mostly you need to assign a client Address to be able to connect, unless you start the local/host client. But you should get something in the console when the client is not starting

dull sun
#

thx, I'm using Tugboat. My server has started ok, but my client will not connect. It's tricky, my server is on a remote Linux machine so console info is limited (or time consuming) and so far I get no console errors on the client side, I am however using an android headset (oculus 2) and so have to use logcat.

late moss
#

Then you might just forgot to open ports for the remote Linux Machine, Tugboat is UDP just as info.
Im sadly not aware if there are some limitations or other things to take care of when using vr headsets, might also just be, when its android that you need to check, if the app has the rights to be able to use wifi/internet

dull sun
#

thx, I've had this all running in with Mirror, using Telepathy Transport. Been working on changing over to FN for a few days now. I might need to try a different Transport maybe.

late moss
#

Well then it really should just be the port tho, telepathy is TCP

dull sun
#

Ports match up server & client sides. My print out from my server side with this: networkManager.TransportManager.Transport.GetClientAddress() gives me: GetClientAddress: localhost, this might be an issue.

late moss
#

But you can open ports for TCP and for UDP, just wanted to make sure, that you have it not only open for TCP

Well yeah, then you may need to set the ClientAddress in the Transport itself or via code

dull sun
#

Ok will check the port 'allowed' types on Monday, I just tried putting the server IP straight into the 'Client Address' field in the Tugboat component, no joy yet. Will get back on this Monday! Thanks for your help today 👍

cloud wave
#

If the server is dedicated/has port opens it shouldn't be an issue. Some people have issues testing on the same machine because of security restrictions and they have to allow access but its rare.

#

but as mentioned tugboat = udp, telepathy = tcp. Generally security policies are more accepting of tcp connections for some reason.

dull sun
#

Is it possible to use telepathy or is that not recommended (or impossible)?

cloud wave
#

TCP is pointless, it's slow and has a lot of overhead.

#

Only place we use TCP is where we have to in webgl

dull sun
#

👍

dull sun
#

I am trying to trace events. I have noticed when I start my server, in the Tugboat.cs, StartConnection(bool server) is called twice (and so also StartServer() is called twice) the first time it's called the port number matches the default value in the inspector '7770' the second time it's called the port has changed to the one my dedicated server software hands out like 9001 or 9002 etc (because I can run multiple instances of my Game Server) anyway, it's this second port number that my client is using. Can you see an issue here?

#

What would be the best line of code to print out the port number of the server from a client that is trying to connect to it? i.e. networkManager.ServerManager.... I want to double check that as my client tries to connect the port numbers match.

dull sun
#

So maybe its because I call SetPort() just before I call networkManager.ServerManager.StartConnection(); does this mean somewhere else the server is being started at runtime? if so can I override to allow me to pass my port number instead of what is in the Tugboat port field?

dull sun
#

ok, commented out StartConnection() in StartForHeadless() (ServerManager.cs) and now I just get the one call with my port number. I'm still not connecting yet. I got a few new errors (server side): Write method not found for ClientConnectionChangeBroadcast. Use a supported type or create a custom serializer.
Write method not found for ConnectedClientsBroadcast. Use a supported type or create a custom serializer.
Write method not found for EmptyStartScenesBroadcast. Use a supported type or create a custom serializer.
Write method not found for ClientConnectionChangeBroadcast. Use a supported type or create a custom serializer.

late moss
#

You might not have added ServerManager to your NetworkManager, if you do so, it exposes a boolean in the editor, called something like "autoStartOnHeadless" that you need to disable, if you configure your Server somewhere over files or configs.
And SetPort does not start a server, it just changes the port

dull sun
dull sun
#

Odd, that didn't work for some reason. I'll go back to commenting it out. (for now)

dull sun
#

Both networkManager.ClientManager.StartConnection() and networkManager.ServerManager.StartConnection(); are using the same address and port numbers, I get no errors anymore, but still the client can't connect. I have my client connection continue attempts in a coroutine with the while condition while (!networkManager.ClientManager.Started) which I understand should stop once a connection is made? The equivalent Mirror code was 'while (!NetworkClient.isConnected)' Can you guys think of any other things I should look into? thanks

#

also... what is the Server 'Ipv 4 Bind Address' in the Tugboat component? do I need to add an address here?

late moss
#

I would simply listen to the event of the ClientManager and count the attempts down, instead of a coroutine

The Bind Address is the interface to which the server is listen to, its like when you configure upstreams in nginx or have liberty listen or a apache server. As example, 192.168.178.43 is my local address, if i bind it to it, then it binds to it and only listen to calls for it. For more informations just look up. And then there are like 0.0.0.0 which listen on all things, great for testing, but bad for production