|
CX Framework
Cross-platform C utility framework
|
#include <net_shared.h>
Data Fields | |
| int32 | nthreads |
| Number of worker threads, or 0 for polled mode. | |
| flags_t | flags |
| NetQueueFlags. | |
| size_t | recvBufSize |
| Size of each pooled receive buffer. | |
| uint32 | recvBufInitial |
| Buffers preallocated at queue creation. | |
| uint32 | recvBufMax |
| Hard cap on live buffers; the receive memory ceiling. | |
| uint32 | maxflows |
| Cap on concurrent flows across the queue (0 = unlimited) | |
| uint32 | reclaimBatch |
| Flows to reclaim per cap hit. | |
| bool | noReclaim |
| Never reclaim, even at the cap. | |
| int64 | reclaimMinIdle |
| Minimum time a flow must have been idle before cap-pressure reclaim may evict it, in microseconds (0 = any flow is fair game) | |
| size_t | sendHigh |
| Default send high watermark for sockets on this queue. | |
| size_t | sendLow |
| int64 | connectTimeout |
| How long a single connect attempt may run before it's cancelled and the next resolved address is tried, in microseconds (0 = a sensible default) | |
| int64 | connectAttemptTimeout |
| Shorter timeout for connect attempts other than the last remaining address of their family, in microseconds (0 = disabled – every attempt gets the full connectTimeout) | |
| NetConnectPref | connectPref |
| Default address-family preference for connects on this queue (see NetConnectPref) | |
Creation-time configuration for a NetQueue.
Start from a preset and override what you need:
Definition at line 58 of file net_shared.h.
| int64 NetQueueConfig::connectAttemptTimeout |
Shorter timeout for connect attempts other than the last remaining address of their family, in microseconds (0 = disabled – every attempt gets the full connectTimeout)
Addresses are tried interleaved by family (IPv4/IPv6), so this keeps a dead family from using up a full connectTimeout on every one of its addresses before the other family gets a turn. Each family's last remaining address always gets the full connectTimeout.
Definition at line 101 of file net_shared.h.
| NetConnectPref NetQueueConfig::connectPref |
Default address-family preference for connects on this queue (see NetConnectPref)
A socket inherits this when added to the queue, the same way sendHigh/sendLow are inherited; set NetSocket::connectPref to override it per socket.
Definition at line 107 of file net_shared.h.
| int64 NetQueueConfig::connectTimeout |
How long a single connect attempt may run before it's cancelled and the next resolved address is tried, in microseconds (0 = a sensible default)
This is a per-address limit, not a total budget: a host that resolves to several dead addresses can still take this long on each one. The last remaining address of each family always gets the full timeout (see connectAttemptTimeout), so a family's one real chance is never cut short.
Definition at line 93 of file net_shared.h.
| int64 NetQueueConfig::reclaimMinIdle |
Minimum time a flow must have been idle before cap-pressure reclaim may evict it, in microseconds (0 = any flow is fair game)
Protects live sessions from churn at the flow cap: when every flow has been active more recently than this, nothing is reclaimed and the new peer is refused through the NET_FlowRefused handler instead – where the application can still admit it explicitly with netqueuePromoteFlow(). Worth setting when session setup is expensive enough that evicting a hot flow costs more than turning a new peer away.
Definition at line 80 of file net_shared.h.
| size_t NetQueueConfig::sendLow |
Default send low watermark for sockets on this queue (both are per stream on a QUIC socket – see NetSocket)
Definition at line 83 of file net_shared.h.