Skip to main content
Version: 5.9.0

RegisterRelayCallback

Register callback for relay messages coming from peers.

Usage

http://localhost:3000
//For the client library version 4.5.6, it now includes a netId parameter.
static void relayCallback(short netId, byte[] data)
{
string message = Encoding.ASCII.GetString(data, 0, data.Length);
Console.WriteLine("netId: " + netId);
Console.WriteLine("relayCallback: " + message);
}

//For the client library version 4.5.5 and older, it only has one data parameter.
static void relayCallback(byte[] data)
{
string message = Encoding.ASCII.GetString(data, 0, data.Length);
Console.WriteLine("relayCallback: " + message);
}
_bc.RelayService.RegisterRelayCallback(relayCallback);