Skip to main content

pamoja_loopback_transport_send

Function pamoja_loopback_transport_send 

Source
#[unsafe(no_mangle)]
pub unsafe extern "C" fn pamoja_loopback_transport_send( transport: *mut PamojaLoopbackTransport, topic: *const c_char, payload: *const u8, payload_len: usize, ) -> PamojaStatus
Expand description

Publishes a payload to a topic on the broker.

§Arguments

  • transport - the link.
  • topic - the destination topic, as null-terminated UTF-8.
  • payload - the bytes to publish.
  • payload_len - the length of payload.

§Returns

PamojaStatus::Ok once every subscriber has been handed the message.

§Safety

transport must be a live handle, topic a valid null-terminated UTF-8 string, and payload must point to at least payload_len readable bytes or be null when that length is 0.