The message must have 0 or 1 parameters. The message will be ignored.

I have an EventHandler declared as such:

public EventHandler OnDisconnected = null;

It is referenced like this:

clientSocket.OnDisconnected += this.OnDisconnected;

 private void OnDisconnected(object sender, System.EventArgs args)
 {

 }

This results in the following error in the console. Does anyone know how to fix this? Thanks in advanced.

Script error: OnFailedToConnect
The message must have 0 or 1 parameters.
The message will be ignored.

OnFailedToConnect is a MonoBehaviour message event. Maybe you declared it with more than 1 parameter?

OnDisconnected is a message event used by Unity’s built-in script NetworkServerSimple, so Unity may be confusing your custom OnDisconnected method with the message event. Try changing the method name from OnDisconnected to OnClientSocketDisconnected.