pdcomm_gem_spool_sync
Function
Synchronizes the spool with the current communication state.
PdcommStatus pdcomm_gem_spool_sync(PdcommTcpEndpoint *endpoint, uint64_t now, PdcommGemSpoolWriteInfo *info)Call after handling TCP and GEM events, and whenever the connection may have changed. The call observes whether the endpoint is Selected and GEM is Communicating, and records the current HSMS generation and selection.
- When communication is up, the spool tracks the current generation; a new generation ends any previous transmission run.
- When communication is down, an enabled, inactive spool is activated (#PDCOMM_GEM_SPOOL_ACTIVATED; with an empty queue, statistics reset and
start_timebecomesnow). A previous activation that failed before installation is retried.
Sync never starts transmission. Capture, send, response, and delivery calls require a current successful sync.
Parameters
| Name | Description |
|---|---|
endpoint | Endpoint with an Equipment spool. |
now | Application timestamp recorded for activation. |
info | Receives the activation outcome, if any. Must not be NULL. |
Returns
#PDCOMM_OK on success; #PDCOMM_SPOOL_UNCONFIRMED when activation was installed without a confirmed directory sync (the spool is still synchronized); #PDCOMM_INVALID_ARGUMENT when info or endpoint is NULL or info is too small; #PDCOMM_INVALID_STATE when no Equipment spool is configured; #PDCOMM_BACKPRESSURE when a staged TCP event is pending; a persistence error such as #PDCOMM_IO_ERROR when activation could not be installed (the spool stays unsynchronized); #PDCOMM_POISONED after a contained panic.