Forge Developers | Slack Search | Trello Board Changelog
|
Forge Networking Remastered has been released!!! This is now listed in your Profile!
Go Back

Hosting a Server

Main Method Call

Creating a server/host is as simple as calling one function Networking.Host at any time. Below is a sample of the method and its arguments.

Connection Events

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.

Disconnection Events

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 Networking.Socket[15937].disconnected event.

Title

Body

Title

Body


Input:

Title

Body


Input: