privateSend method

  1. @override
Future<void> privateSend(
  1. dynamic data,
  2. bool chunked
)
override

Implementation

@override
Future<void> privateSend(dynamic data, bool chunked) async {
  try {
    ByteBuffer? blob = pack(data);
    if (!chunked && blob.lengthInBytes > chunker.chunkedMTU) {
      await _sendChunks(Uint8List.view(blob));
      return;
    }
    bufferedSend(Uint8List.view(blob));
    blob = null;
  } on OutOfMemoryError catch (err,stack) {
    Timer(Duration(seconds: 2), () {
      privateSend(data, chunked);
    });
  }
}