pdcomm_secs1_submit
Function
Queues one message for transmission.
PdcommStatus pdcomm_secs1_submit(PdcommSecs1Endpoint *endpoint, const PdcommSecs1Message *message, PdcommSecs1Token *out_token)The endpoint sends one message at a time: the next submission is accepted after the current one produced #PDCOMM_SECS1_EVENT_OUTBOUND_COMPLETE, #PDCOMM_SECS1_EVENT_OUTBOUND_FAILED, or a fault. The body is copied on acceptance and split into blocks. Success means acceptance only; transmission happens in pdcomm_secs1_poll().
Parameters
| Name | Description |
|---|---|
endpoint | Started endpoint. |
message | Message to send; see ::PdcommSecs1Message for the field rules. |
out_token | Receives the submission token. Zeroed first, so it is zero after every failure. |
Returns
#PDCOMM_OK when the message was accepted; #PDCOMM_INVALID_ARGUMENT when message, out_token, or endpoint is NULL, or a message field is invalid; #PDCOMM_BACKPRESSURE when a staged event must be retrieved first or another message is still being sent; #PDCOMM_INVALID_STATE when the endpoint is not started or is faulted, or on a wrong-thread, concurrent, or reentrant call; #PDCOMM_LIMIT_EXCEEDED when the body exceeds max_outbound_body_bytes, max_body_bytes, max_outbound_blocks, or max_blocks, or the submission numbers of this generation are exhausted; #PDCOMM_ALLOCATION_FAILED when the body or blocks cannot be copied; #PDCOMM_POISONED when the endpoint is poisoned.
Notes
- Ownership: the message and body remain owned by the caller and may be released when the call returns.
- Thread safety: call only on the creating thread.