Skip to main content

pamoja_ladder_recv

Function pamoja_ladder_recv 

Source
#[unsafe(no_mangle)]
pub unsafe extern "C" fn pamoja_ladder_recv( ladder: *mut PamojaLadder, out_message: *mut *mut PamojaMessage, ) -> PamojaStatus
Expand description

Waits for the next message from any rung that listens.

Every connected rung that listens is polled together and the first to deliver wins. A rung whose link ends is left out until the next pamoja_ladder_connect.

§Arguments

  • ladder - the ladder.
  • out_message - receives a message handle to release with pamoja_message_free.

§Returns

PamojaStatus::Ok with a message, or PamojaStatus::Closed if no connected rung listens: none was added, the ladder is not connected, or every listening link has ended.

§Safety

ladder must be a live handle and out_message must be writable.