How To Register An RPC Method To Be Invoked Remotely

You need to register a handler function for each RPC call (controlled by RPC ID)

Each RPC call must have an RPC ID and when you register a handler, you must specify its RPC ID and when calling the RPC, you must specify the same RPC ID.

// rpcID gives RPCHandlerForIDOne, a unique ID to be associated with.
int rpcID = 1;

bool registered = rpc.Register(rpcID, RPCHandlerForIDOne);

private void RPCHandlerForIDOne(byte[] message)
{
    // Do something awesome here
}