Skip to content
Start free evaluation

PdcommTcpOptions

Struct

Configuration for pdcomm_tcp_create().

typedef struct PdcommTcpOptions { ... } PdcommTcpOptions

Declared in: #include <pdcomm_tcp.h>

Every timer and limit is application policy; zero is invalid unless a field says otherwise. The endpoint copies the structure, so you can release it after pdcomm_tcp_create() returns.

Members

connect_timeout_ms

Field

Active-mode TCP connect timeout in milliseconds; must be nonzero.

uint64_t connect_timeout_ms

Declared in: #include <pdcomm_tcp.h>

The connect call runs inside pdcomm_tcp_poll() and can block it for up to this long.

initial_system_bytes

Field

First system bytes value of each connection generation.

uint32_t initial_system_bytes

Declared in: #include <pdcomm_tcp.h>

Each new outgoing message uses the next value. The counter restarts at this value for every generation and does not wrap: after 0xFFFFFFFF, submissions fail with #PDCOMM_LIMIT_EXCEEDED.

item_limits

Field

SECS-II limits for message bodies.

PdcommSecsLimits item_limits

Declared in: #include <pdcomm_tcp.h>

Applied to bodies passed to pdcomm_tcp_request() and pdcomm_tcp_reply() and to received data message bodies. item_limits.struct_size must be at least sizeof(PdcommSecsLimits).

max_application_bytes

Field

Largest total body size of the events in the queue read by pdcomm_tcp_next_event(), in bytes; must be at least PdcommTcpOptions::max_frame_bytes minus 14.

size_t max_application_bytes

Declared in: #include <pdcomm_tcp.h>

max_application_events

Field

Capacity of the queue read by pdcomm_tcp_next_event(); must be nonzero.

size_t max_application_events

Declared in: #include <pdcomm_tcp.h>

When the queue is full, the endpoint holds further events back until you drain it.

max_events

Field

Capacity of the internal session event queue; must be at least 2 * #PDCOMM_TCP_MAX_TRANSACTIONS + 8 (72).

size_t max_events

Declared in: #include <pdcomm_tcp.h>

max_frame_bytes

Field

Largest HSMS frame in bytes, including the 4-byte length field and the 10-byte header; must be at least 14.

size_t max_frame_bytes

Declared in: #include <pdcomm_tcp.h>

The largest message body is this value minus 14. A larger outgoing body is rejected with #PDCOMM_LIMIT_EXCEEDED; a larger incoming frame closes the connection.

max_io_chunk

Field

Largest number of bytes passed to one socket read or write call; must be nonzero.

size_t max_io_chunk

Declared in: #include <pdcomm_tcp.h>

max_queued_bytes

Field

Largest total size of message bodies held in the internal session queue, in bytes.

size_t max_queued_bytes

Declared in: #include <pdcomm_tcp.h>

Submissions that would exceed it return #PDCOMM_BACKPRESSURE. A body that does not fit in a frame returns #PDCOMM_LIMIT_EXCEEDED first. Zero allows only messages without a body.

max_write_bytes

Field

Largest total size of the socket write queue in bytes; must be at least 14 and at least PdcommTcpOptions::max_frame_bytes.

size_t max_write_bytes

Declared in: #include <pdcomm_tcp.h>

max_write_frames

Field

Largest number of frames in the socket write queue; must be nonzero.

size_t max_write_frames

Declared in: #include <pdcomm_tcp.h>

mode

Field

Connection mode: #PDCOMM_TCP_ACTIVE or #PDCOMM_TCP_PASSIVE.

uint32_t mode

Declared in: #include <pdcomm_tcp.h>

poll_budget

Field

Largest number of internal actions one pdcomm_tcp_poll() call performs; must be nonzero.

size_t poll_budget

Declared in: #include <pdcomm_tcp.h>

reserved

Field

Reserved; must be 0.

uint16_t reserved

Declared in: #include <pdcomm_tcp.h>

session_id

Field

HSMS session ID (device ID) for data messages.

uint16_t session_id

Declared in: #include <pdcomm_tcp.h>

Outgoing data messages carry it, and received data messages with a different value are reported as #PDCOMM_TCP_WRONG_SESSION. Control messages always use 0xFFFF.

shutdown_timeout_ms

Field

Graceful shutdown limit in milliseconds; must be nonzero.

uint64_t shutdown_timeout_ms

Declared in: #include <pdcomm_tcp.h>

After pdcomm_tcp_stop(), the connection stays open for at most this long to write queued frames such as Separate.req, and is then closed.

struct_size

Field

Size of this structure in bytes; set to sizeof(PdcommTcpOptions) or larger.

size_t struct_size

Declared in: #include <pdcomm_tcp.h>

t3_ms

Field

T3 reply timeout in milliseconds; must be nonzero.

uint64_t t3_ms

Declared in: #include <pdcomm_tcp.h>

The timer starts when a W-bit data request has been completely written to the socket. Expiry fails the request with #PDCOMM_TCP_T3_TIMEOUT.

t5_ms

Field

T5 connect separation timeout in milliseconds; must be nonzero.

uint64_t t5_ms

Declared in: #include <pdcomm_tcp.h>

In active mode, the delay between the end of a connection (or a failed attempt) and the next attempt, spent in #PDCOMM_TCP_RETRY_WAIT.

t6_ms

Field

T6 control transaction timeout in milliseconds; must be nonzero.

uint64_t t6_ms

Declared in: #include <pdcomm_tcp.h>

Limits the wait for Select.rsp, Deselect.rsp, and Linktest.rsp after the request is written. Expiry fails the transaction with #PDCOMM_TCP_T6_TIMEOUT and closes the connection.

t7_ms

Field

T7 not-selected timeout in milliseconds; must be nonzero.

uint64_t t7_ms

Declared in: #include <pdcomm_tcp.h>

A connection that stays NOT SELECTED for this long after it is established, or after a Deselect, is closed.

t8_ms

Field

T8 network intercharacter timeout in milliseconds; must be nonzero.

uint64_t t8_ms

Declared in: #include <pdcomm_tcp.h>

The connection is closed when a partially received frame makes no progress for this long.

version

Field

Options layout version; must be #PDCOMM_TCP_OPTIONS_VERSION.

uint32_t version

Declared in: #include <pdcomm_tcp.h>

write_timeout_ms

Field

Write timeout in milliseconds; must be nonzero.

uint64_t write_timeout_ms

Declared in: #include <pdcomm_tcp.h>

When the frame at the head of the write queue is not completely written within this time, the connection fails with a #PDCOMM_TCP_OP_WRITE transport error of kind #PDCOMM_TCP_IO_TIMED_OUT.