Connecting to a Server
Main Method Call
Connecting to a server/host is as simple as calling one function
Networking.Connect at any time. Below is a sample of the method and its arguments.
When you attempt to host a server you can register connection events,
register connection failure events, or check if the connection is currently established.
To check if a connection is established, you can use the following:
To register a delegate to the connected event (which fires as soon as the port is bound
and listening) you just need to assign the event directly to the socket.
I think we all need to know when the network has died so that we can not have our
game simply crash. So, in order to find out when we are disconnected,
we will need to register the
You can also use the
Networking.Sockets.serverDisconnected event to
execute logic for when the server disconnects the player for any given reason.