sendProbe method
Sends a probe packet to elicit an ACK. The probe packet contains a PING frame.
Implementation
void sendProbe(ConnectionId destCid, ConnectionId srcCid, int destId, int srcId) {
// FIX: Probe packets should NOT consume new sequence numbers.
// Like ACKs, they are not registered for retransmission, and if lost,
// the receiver's _nextExpectedSeq gets stuck forever. Use the last
// sent sequence number (or 0 if none sent yet) to avoid sequence gaps.
final probeSeq = lastSentPacketNumber >= 0 ? lastSentPacketNumber : 0;
final probePacket = UDXPacket(
destinationCid: destCid,
sourceCid: srcCid,
destinationStreamId: destId,
sourceStreamId: srcId,
sequence: probeSeq,
frames: [PingFrame()],
);
onSendProbe?.call(probePacket);
}