Home

maxRetransmits

maxRetransmits is an option used in the WebRTC RTCDataChannelInit configuration to control the reliability of messages sent over a data channel. It enables partial reliability by limiting the number of retransmissions that will be attempted for each message, trading delivery assurance for lower latency.

How it works: maxRetransmits is a non-negative integer N. For each message, the underlying transport will try

Usage: To enable limited retransmission, the data channel can be created with a configuration such as {

Compatibility and considerations: Partial reliability through maxRetransmits is supported by major WebRTC implementations, though exact behavior

to
deliver
the
data
up
to
N
retransmissions.
If
the
message
cannot
be
delivered
within
those
attempts,
it
is
dropped
and
not
delivered
to
the
peer.
A
value
of
0
means
no
retransmissions,
i.e.,
best-effort
delivery
with
no
retry.
maxRetransmits
is
mutually
exclusive
with
maxPacketLifeTime;
you
should
choose
one
mechanism
to
govern
reliability,
not
both,
as
they
express
different
retry
policies.
ordered:
true,
maxRetransmits:
5
}.
This
configuration
allows
up
to
five
retransmission
attempts
per
message.
If
time-based
control
is
desired
instead
of
a
fixed
retry
count,
maxPacketLifeTime
can
be
used
to
specify
a
maximum
time
in
milliseconds
for
retries,
rather
than
a
fixed
count.
can
vary
by
browser
and
version.
This
option
is
appropriate
when
low
latency
is
prioritized
over
guaranteed
delivery.
For
applications
requiring
strict
delivery
guarantees,
avoid
enabling
maxRetransmits
and
use
reliably
delivered
channels
instead.
See
also
RTCDataChannelInit,
maxPacketLifeTime,
and
data
channel
reliability
models.