Skip to main content

pamoja_transport_degraded

Function pamoja_transport_degraded 

Source
#[unsafe(no_mangle)]
pub unsafe extern "C" fn pamoja_transport_degraded( transport: *mut PamojaTransport, drop_every: u32, up: u32, down: u32, ) -> *mut PamojaTransport
Expand description

Wraps a transport in a link that loses packets and goes down.

§Arguments

  • transport - the transport to wrap, consumed by this call.
  • drop_every - lose one send in every this many, or 0 to lose none.
  • up - how many sends the link stays up for, or 0 to never go down.
  • down - how many sends it then stays down for.

§Returns

A new handle owning the wrapped transport, or null if transport is null.

§Safety

transport must be a live handle that has not been freed or consumed. After this call it must not be used again, whatever the result.