RealmPacketOut packet = new RealmPacketOut(); int value = 10; packet.WriteInt32(value);
void SendData(RealmPacketOut packet) { // Assume a connection object is available and named 'connection' byte[] data = packet.ToArray(); connection.Send(data, data.Length); } ... RealmPacketOut packet = new RealmPacketOut(); int value = 20; packet.WriteInt32(value); SendData(packet);In this example, we define a SendData function which takes a RealmPacketOut instance and sends it to a connected server. We create a new packet, write an integer value of 20 to it using the WriteInt32 method, and then call the SendData function to send the packet to the server. The package library used for this example is likely the Realm Communication Protocol library.