Mirror Networking: How to check if the host IP is an online server?

I’ve been searching for an answer for this for hours, and I know it has to be something obvious, because it most certainly would need to be used widespread with the mirror networking system, but alas, I cannot find an answer. I type in a random string of letters, and it still connects to a server apparently, and displays the ping as 0 as if it just created a new host. I’ve tried on server failed to connect, but that seems to be a depreciated unet thing, not a mirror thing. Anyone know the mirror syntax to check if the input IP is an active server?

Most likely that is because you are running as the host/server, and not a client. It is completely valid to run a game and server as the host, and still be a client. In that case your ping is zero. You didn’t specify where you typed those characters but you probably mean as the network address of the host. If you were running purely as a client (I have no idea what example or code you are working from so I can’t recommend anything), you would receive callbacks when a connection attempt failed. For a host starting up, the only reason for failing would generally be if you had an existing host running on the same port number. As far as the host being “online” on the internet, that depends on your local machine is connected and visible to the internet and if there is no firewall in the way preventing any connections to the port number your server is listening on. If all these concepts are foreign to you, then you will need to learn these basics, and you certainly can, and then you will need to learn how Mirror works. Ultimately Mirror is just allowing you to run a program listening on a port on your machine. If you wanted to create an “online” server there are many different methods to do that like renting a VPS or dedicated machine. Generally “Online” would mean a computer which is not behind a local router with NAT translation, and has a public IP address that will never change.

You can read about the Network Manager class here:
https://mirror-networking.gitbook.io/docs/components/network-manager

Thanks for the answer. Also, I apologize for how poorly I worded this question. I was not running as the host server, but I was calling StartClient with invalid IP addresses (purposefully) and it would still take me to the lobby, without returning any errors. My work around, was that I just used the method that calls whenever the client joins a server (what do you know, when it attempted to join a server that doesn’t exist, that method didn’t run) and passed a boolean where necessary from that script, to make sure we don’t enter the lobby screen until we’ve confirmed that we’re in an actual server.

So I guess what I wanted was an equivalent to onfailedtoconnect from unet, but my solution is working for me fine. Still, if you know of a similar method that I can use that is similar to that old unet one, I would love to hear it!