#[Unity Transport] Ping Server

1 messages · Page 1 of 1 (latest)

pseudo monolith
#

Is there a way to "ping" an EndPoint or send a small packet without establishing a connection?
If a client disconnects I'd like to ping the Server to see if it's still active and the Client may be able to reconnect.

patent kite
#

Best you can do is a C# Ping if you know the server IP address. But that won't tell you if the Unity server is running

pseudo monolith
#

Mhhh that would work for a self hosted server. Would you happen to know if that works with UGS server hosting as well?
When you host multiple games on a single physical server they get separate endpoints, so I think that should actually work?

patent kite
#

Honestly the easiest way is to try to connect and wait for it to time out.
Otherwise you are left with trying to use the Multiplay API GetAllocation() if you save it from the matchmaker

pseudo monolith
#

Right, I had the idea for the ping because that makes it easy to decide if I want to present the user with the option to attempt reconnection. If I don't do that I have to somehow decide if I want to give the user that option (if the user disconnected due to timing out, that's easy as Unity Transport already let's you know that. But what if the game just outright crashes?)

patent kite
#

on the client its hard to tell the difference between a server crash and losing network connection.

pseudo monolith
#

oh that's right, I didn't even think about the server crashing