retransmitTimeout property

int get retransmitTimeout

The retransmission timeout in milliseconds

Implementation

int get retransmitTimeout {
  // If we don't have an RTT sample yet, use a conservative initial RTO.
  // See RFC 9002, Section 6.2.1.
  if (congestionController.smoothedRtt == Duration.zero) {
    return 1000; // 1 second initial RTO
  }
  // RTO = smoothed_rtt + 4 * rttvar
  final rto = congestionController.smoothedRtt.inMilliseconds +
      (4 * congestionController.rttVar.inMilliseconds);
  return rto.clamp(200, 5000); // Clamp to a reasonable range (increased min)
}