pub enum OutgoingState {
Idle(bool),
SendingCon(RetransmissionState, Duration),
AwaitingResponse(Instant),
SendingNon(RetransmissionState, bool, Duration),
SendingPing(RetransmissionState, bool, Duration),
SendingNotificationCon(RetransmissionState),
SendingNotificationNon,
}Expand description
Current state of an outgoing communication
Variants§
Idle(bool)
Ready to send a new request. The contained bool stores is the last communication attempt
(if any) was successful. If so, the respective received response can be obtained with
OutgoingCommunication::response.
SendingCon(RetransmissionState, Duration)
Sending a CON request and waiting for an ACK or piggybacked response. The additional
Duration is used to start an application-level timeout to wait for a separate response
if an ACK is received.
AwaitingResponse(Instant)
ACK received, waiting for separate response. The Instant is set to when we should time
out, i.e. state entry plus the Duration from SendingCon.
SendingNon(RetransmissionState, bool, Duration)
Sending a NON request and waiting for a response. The RetransmissionState is used to
limit the number of application-level (user-triggered) retransmissions. As a policy, we
limit ourselves to the same exponential backoff strategy that is used for CON messages,
i.e. if the user requests a retransmission but the last exponential backoff timeout has not
yet expired, the retransmission will be delayed. If the next opportunity to (re)transmit
shall be used is stored in the bool value. This is set to true automatically when
schedule_non is called or when the user calls schedule_retransmission.
The additional Duration is used to trigger application-level timeouts based on the
last (re)transmission instant.
SendingPing(RetransmissionState, bool, Duration)
Sending a ping and waiting for the associated RST message.
From the messaging layer perspective, this is identical to OutgoingState::SendingNon
(waiting for a matching response without automatic retransmissions), its documentation
applies here, too.
SendingNotificationCon(RetransmissionState)
Sending a CON notification and waiting for an ACK
SendingNotificationNon
Sending a NON notification
Trait Implementations§
Source§impl Clone for OutgoingState
impl Clone for OutgoingState
Source§fn clone(&self) -> OutgoingState
fn clone(&self) -> OutgoingState
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more