Skip to content
Start free evaluation

pdcomm_gem_host_acknowledge_event

Function

Sends the Event Report Acknowledge (S6F12) for a received S6F11.

PdcommStatus pdcomm_gem_host_acknowledge_event(PdcommTcpEndpoint *endpoint, PdcommGemResult *result, uint8_t acknowledgement)

Declared in: #include <pdcomm_gem_reports.h>

A validated S6F11 produces a #PDCOMM_GEM_PRIMARY result with outcome #PDCOMM_GEM_EVENT_RECEIVED and reply_sent 0; there is no automatic acknowledgement. Acknowledge only after the application has accepted or rejected the report. The result retains the original message header and an owned copy of the body, so the original TCP event may already be destroyed. On success the result is marked acknowledged, its acknowledgement and reply_sent fields are set, and a repeated call returns #PDCOMM_STALE_TOKEN. An allocation or backpressure failure leaves the result unacknowledged so that the acknowledgement alone can be retried.

Parameters

NameDescription
endpointHost endpoint that produced result.
resultEvent result from pdcomm_gem_handle_event().
acknowledgementACKC6 value, 0 (accepted) to 63.

Returns

#PDCOMM_OK when S6F12 was queued; #PDCOMM_INVALID_ARGUMENT when endpoint or result is NULL, acknowledgement is greater than 63, or result is not a received event report; #PDCOMM_STALE_TOKEN when the result was already acknowledged, came from another endpoint or connection generation, predates a deselect/reselect on the same connection, or its incoming TCP transaction was already answered; #PDCOMM_INVALID_STATE when the endpoint is not a Host or is not Communicating; #PDCOMM_BACKPRESSURE when a TCP event is staged or the send queue is full; #PDCOMM_ALLOCATION_FAILED, #PDCOMM_INVALID_DATA, #PDCOMM_IO_ERROR, or #PDCOMM_POISONED.

Notes

  • Thread safety: this call mutates result. Never run it concurrently with getters on, or destruction of, the same result.