Skip to content
Start free evaluation

pdcomm_gem_spool_respond

Function

Answers an incoming S2F43, S2F59, or S6F23 request (Equipment).

PdcommStatus pdcomm_gem_spool_respond(PdcommTcpEndpoint *endpoint, PdcommGemResult *result)

Declared in: #include <pdcomm_gem_spooling.h>

result must be an unresponded #PDCOMM_GEM_SPOOL_RECEIVED primary from this endpoint, generation, and selection, and its incoming reply slot must still be live. GEM must be Communicating and the spool synchronized. The call prepares the reply, installs any spool change, and only then queues the reply:

  • **S2F43** is checked against the catalog. An invalid selection gets the fixed detailed S2F44 rejection (RSPACK 1 with STRACK 1 stream not allowed, 2 unknown stream, 3 unknown function, or 4 secondary function) and changes nothing. A valid selection replaces the current selection, keeps the policy, and is installed before the S2F44 acceptance is sent.
  • **S2F59** is answered with S2F60 carrying the current selection.
  • **S6F23** is answered with RSDA 1 (busy) while transmitting or delivering, 2 (no spooled data) when the spool is empty, or 0 (accepted). An accepted purge is installed before the S6F24 is sent; an accepted transmit starts a transmission run only after the S6F24 has entered the send queue.

A malformed request is never partially applied. An installed reply survives a send failure: calling again resends only the retained reply, without another installation. After #PDCOMM_SPOOL_UNCONFIRMED the reply is retained but not sent until pdcomm_gem_spool_confirm_reply() accepts the uncertainty.

Parameters

NameDescription
endpointSynchronized, Communicating Equipment endpoint with a spool.
resultSpool request result from pdcomm_gem_handle_event(). Its reply_sent, acknowledgement, and processing fields are updated.

Returns

#PDCOMM_OK when the reply was queued; #PDCOMM_SPOOL_UNCONFIRMED when the change was installed without a confirmed directory sync and no reply was sent; #PDCOMM_STALE_TOKEN when the result belongs to another endpoint, generation, or selection, was already answered, or its incoming slot is gone; #PDCOMM_INVALID_STATE when the result is not a spool request, GEM is not Communicating, or the spool is not synchronized; #PDCOMM_BACKPRESSURE when a staged TCP event is pending, the send queue is full, or a purge or reconfiguration meets an active delivery; #PDCOMM_INVALID_DATA for a malformed request; #PDCOMM_INVALID_ARGUMENT for a NULL argument; a persistence error such as #PDCOMM_IO_ERROR (nothing installed, retry allowed); #PDCOMM_LIMIT_EXCEEDED, #PDCOMM_ALLOCATION_FAILED, or #PDCOMM_POISONED.

Notes

  • A successful acknowledgement is local evidence only; the Host cannot infer remote persistence from it.