waitForClientDataSocket method

Future<void> waitForClientDataSocket({
  1. Duration? timeout,
})

Implementation

Future<void> waitForClientDataSocket({Duration? timeout}) {
  var result = dataListener!.first;
  if (timeout != null) {
    result = result.timeout(timeout, onTimeout: () {
      throw TimeoutException(
          'Timeout reached while waiting for client data socket');
    });
  }
  return result.then((value) => dataSocket = value);
}