Send
Send a packet to peer(s).
Method Parameters
Parameter | Description |
---|---|
data | Byte array for the data to send |
size | Size of data in bytes |
toNetId | The net id to send to, TO_ALL_PLAYERS to relay to all |
reliable | Send this reliably or not |
ordered | Received this ordered or not |
channel | One of: (CHANNEL_HIGH_PRIORITY_1, CHANNEL_HIGH_PRIORITY_2, CHANNEL_NORMAL_PRIORITY, CHANNEL_LOW_PRIORITY) |
Usage
http://localhost:3000
- C#
- C++
- Objective-C
- Java
- JavaScript
- Dart
- Cloud Code
- Raw
RSDataCallback rsDataCallback = (response) =>
{
Debug.Log(string.Format("Success | {0}", response));
};
_bc.RelayService.Send(data, size, toNetId, reliable, ordered, channel);
_bc->getRelayService()->send(const uint8_t* in_data, int in_size, uint64_t toNetId, bool in_reliable, bool in_ordered, eRelayChannel in_channel);
_bc->getRelayService()->send(const uint8_t* in_data, int in_size, uint64_t toNetId, bool in_reliable, bool in_ordered, eRelayChannel in_channel);
_bc->getRelayService()->send(const uint8_t* in_data, int in_size, uint64_t toNetId, bool in_reliable, bool in_ordered, eRelayChannel in_channel);
_bc.relay.send(const uint8_t* in_data, int in_size, uint64_t toNetId, bool in_reliable, bool in_ordered, eRelayChannel in_channel);
int aNetId = 2;
Uint8List bytes = utf8.encode("Some Data here");
_bc.relayService.send(bytes, aNetId,
reliable: true,
ordered: true,
channel: BrainCloudRelay.channelHighPriority_1);
// N/A
// N/A