createDataStream method

  1. @override
Future<int?> createDataStream(
  1. bool reliable,
  2. bool ordered
)

Creates a data stream.

Each user can create up to five data streams during the lifecycle of the RtcEngine.

Deprecated

This method is deprecated from v3.3.1.

Note

  • Set both the reliable and ordered parameters to true or false. Do not set one as true and the other as false.

Parameter reliable Sets whether or not the recipients are guaranteed to receive the data stream from the sender within five seconds:

  • true: The recipients receive the data from the sender within five seconds. If the recipient does not receive the data within five seconds, the SDK triggers the RtcEngineEventHandler.streamMessageError callback and returns an error code.
  • false: There is no guarantee that the recipients receive the data stream within five seconds and no error message is reported for any delay or missing data stream.

Parameter ordered Sets whether or not the recipients receive the data stream in the sent order:

  • true: The recipients receive the data in the sent order.
  • false: The recipients do not receive the data in the sent order.

Returns

  • The stream ID, if this method call succeeds.
  • Error code, if this method call fails.

Implementation

@override
Future<int?> createDataStream(bool reliable, bool ordered) {
  return _invokeMethod(
      'createDataStream', {'reliable': reliable, 'ordered': ordered});
}