Skip to content

Instantly share code, notes, and snippets.

@BrentFarris
Last active August 29, 2015 14:13
Show Gist options
  • Save BrentFarris/244b70fbcb0938aa16ca to your computer and use it in GitHub Desktop.
Save BrentFarris/244b70fbcb0938aa16ca to your computer and use it in GitHub Desktop.
Forge Networking Sample: Registering Disconnected
// Note: 15937 is the port number of the socket you started the connection on
Networking.Sockets[15937].disconnected += MyMethod;
void MyMethod()
{
Debug.Log("Connection Closed or Lost");
}
// Or you can in-line if you wish
Networking.Sockets[15937].disconnected += delegate
{
Debug.Log("Connection Closed or Lost");
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment