sendStreamMessageEx abstract method
- required int streamId,
- required Uint8List data,
- required int length,
- required RtcConnection connection,
Sends data stream messages.
A successful method call triggers the onStreamMessage callback on the remote client, from which the remote user gets the stream message. A failed method call triggers the onStreamMessageError callback on the remote client. The SDK has the following restrictions on this method: Each client within the channel can have up to 5 data channels simultaneously, with a total shared packet bitrate limit of 30 KB/s for all data channels. Each data channel can send up to 60 packets per second, with each packet being a maximum of 1 KB. After calling createDataStreamEx, you can call this method to send data stream messages to all users in the channel. If you need a more comprehensive solution for low-latency, high-concurrency, and scalable real-time messaging and status synchronization, it is recommended to use. Call this method after joinChannelEx. Ensure that you call createDataStreamEx to create a data channel before calling this method.
streamId
The data stream ID. You can get the data stream ID by calling createDataStreamEx.data
The message to be sent.length
The length of the data.connection
The connection information. See RtcConnection.
Returns When the method call succeeds, there is no return value; when fails, the AgoraRtcException exception is thrown. You need to catch the exception and handle it accordingly.
Implementation
Future<void> sendStreamMessageEx(
{required int streamId,
required Uint8List data,
required int length,
required RtcConnection connection});