| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Tox.Transport.Stream
Synopsis
- data StreamState = StreamState {}
- initState :: Timestamp -> StreamState
- recordPacketSent :: SeqNum -> Timestamp -> StreamState -> StreamState
- recordPacketAcked :: SeqNum -> Timestamp -> StreamState -> StreamState
- ccInterval :: TimeDiff
- congestionMemory :: TimeDiff
- updateSendRate :: Int -> Timestamp -> StreamState -> StreamState
- recordCongestion :: Timestamp -> StreamState -> StreamState
Documentation
data StreamState Source #
State for Congestion Control (CC) and RTT tracking.
Constructors
| StreamState | |
Fields
| |
Instances
| Eq StreamState Source # | |
Defined in Tox.Transport.Stream | |
| Show StreamState Source # | |
Defined in Tox.Transport.Stream Methods showsPrec :: Int -> StreamState -> ShowS # show :: StreamState -> String # showList :: [StreamState] -> ShowS # | |
initState :: Timestamp -> StreamState Source #
Initial CC state.
recordPacketSent :: SeqNum -> Timestamp -> StreamState -> StreamState Source #
Record when a lossless packet was sent.
recordPacketAcked :: SeqNum -> Timestamp -> StreamState -> StreamState Source #
Record when a packet was acknowledged by the peer. Updates RTT metrics.
updateSendRate :: Int -> Timestamp -> StreamState -> StreamState Source #
Periodically update the send rate based on throughput. Should be called approximately every 1.2s.
recordCongestion :: Timestamp -> StreamState -> StreamState Source #
Record a congestion event (e.g. when peer requests many packets).