LinkConditions

class LinkConditions(val lossRate: Double = 0.0, val duplicationRate: Double = 0.0, val latency: Duration = Duration.ZERO, val jitter: Duration = Duration.ZERO)(source)

How an InMemoryNetwork treats each datagram: it may lose it, deliver it twice, or deliver it late. Different delays for consecutive datagrams reorder them, which is how reordering is simulated.

Decisions are drawn from the network's seeded random source, so a test run is reproducible.

Constructors

Link copied to clipboard
constructor(lossRate: Double = 0.0, duplicationRate: Double = 0.0, latency: Duration = Duration.ZERO, jitter: Duration = Duration.ZERO)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

probability in 0..1 that a delivered datagram arrives a second time.

Link copied to clipboard

True when datagrams are delivered immediately, without a coroutine per datagram.

Link copied to clipboard

extra delay drawn uniformly from 0..jitter for each copy of a datagram.

Link copied to clipboard

fixed delay before delivery.

Link copied to clipboard

probability in 0..1 that a datagram is dropped.

Functions

Link copied to clipboard
open override fun toString(): String