onData method

  1. @override
Future<void> onData()
override

Whenever the socket receives data, this method is called, if it is non-null.

Implementation

@override
Future<void> onData() async {
  // The ack timer does not matter if we are currently in the middle of receiving
  // data.
  await _ackLock.synchronized(() {
    if (_pendingAcks > 0) {
      _resetAckTimer();
    }
  });
}