pub enum ListenerBehavior {
Accepting,
Refusing,
DelayingUntil(Instant),
}Expand description
How a TCP listening address answers connects, set with set_listener_behavior. It applies
to a tester’s listener and to one of the code under test alike, and to an address nothing
listens on yet.
Variants§
Accepting
Answers as the address’s own state says: a listener accepts, no listener resets. Setting it removes any behaviour the address had.
Refusing
Answers every SYN with a reset: the connect fails with ECONNREFUSED at once on unix
(RFC 9293 §3.10.7.3, a RST in SYN-SENT), and with WSAECONNREFUSED after the retries
Windows makes on a reset (WINDOWS_REFUSED_AFTER, measured).
DelayingUntil(Instant)
Drops every SYN until then, as a SYN-flooded listener does: the connect completes at the first SYN retransmission after it, or times out when the host OS gives up first.
Trait Implementations§
Source§impl Clone for ListenerBehavior
impl Clone for ListenerBehavior
impl Copy for ListenerBehavior
Source§impl Debug for ListenerBehavior
impl Debug for ListenerBehavior
Source§impl Default for ListenerBehavior
impl Default for ListenerBehavior
impl Eq for ListenerBehavior
Source§impl PartialEq for ListenerBehavior
impl PartialEq for ListenerBehavior
impl StructuralPartialEq for ListenerBehavior
Auto Trait Implementations§
impl Forget for ListenerBehavior
impl Freeze for ListenerBehavior
impl RefUnwindSafe for ListenerBehavior
impl Send for ListenerBehavior
impl Sync for ListenerBehavior
impl Unpin for ListenerBehavior
impl UnsafeUnpin for ListenerBehavior
impl UnwindSafe for ListenerBehavior
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more