Skip to main content

pamoja_coap_server_recv_within

Function pamoja_coap_server_recv_within 

Source
#[unsafe(no_mangle)]
pub unsafe extern "C" fn pamoja_coap_server_recv_within( server: *mut PamojaCoapServer, timeout_ms: u64, out_message: *mut *mut PamojaMessage, out_timed_out: *mut bool, ) -> PamojaStatus
Expand description

Waits a limited time for the next reading sent to a path the server takes.

Running out of time loses nothing: a reading that arrives afterwards waits for the next receive.

§Arguments

  • server - the server.
  • timeout_ms - how long to wait, in milliseconds.
  • out_message - receives a message handle, or null when the time ran out.
  • out_timed_out - receives whether the time ran out before a reading arrived.

§Returns

PamojaStatus::Ok with a message or with the time run out, or PamojaStatus::Closed if the server is not connected.

§Safety

server must be a live handle, and out_message and out_timed_out must be writable.