11void _netInit(
void* unused);
13bool netPlatformInit(
void);
16#if defined(_PLATFORM_WIN)
48 NETCONN_Connected = 0,
49 NETCONN_InProgress = 1,
73NetErrorCode netPlatformResolve(_In_opt_ strref host, uint16 port, _Inout_ sa_NetAddr* out);
79uint32 netPlatformIfNameToIndex(_In_z_
const char* name);
84intptr netSockRecv(
NetSockHandle h, _Out_writes_bytes_(len)
void* buf,
size_t len,
89intptr netSockRecvFrom(
NetSockHandle h, _Out_writes_bytes_(len)
void* buf,
size_t len,
106intptr netSockSendTo(
NetSockHandle h, _In_reads_bytes_(len)
const void* buf,
size_t len,
115intptr netSockRecvFromEx(
NetSockHandle h, _Out_writes_bytes_(len)
void* buf,
size_t len,
124intptr netSockSendToEx(
NetSockHandle h, _In_reads_bytes_(len)
const void* buf,
size_t len,
148typedef struct NetSelectSet NetSelectSet;
157_Ret_maybenull_ NetSelectSet* nselCreate(
void);
160void nselDestroy(_Inout_ NetSelectSet** set);
164void nselClear(_Inout_ NetSelectSet* set);
167void nselAdd(_Inout_ NetSelectSet* set,
NetSockHandle h,
bool read,
bool write);
172int nselWait(_Inout_ NetSelectSet* set, int64 timeoutUs);
177_Success_(
return)
bool nselNext(_Inout_ NetSelectSet* set, _Out_
NetSockHandle* h, _Out_
bool* r,
181void nselWake(_Inout_ NetSelectSet* set);
209 NMSG_FilterNotify = 7,
228#define NET_FLOW_ENCQ_MAX 64
240_Ret_maybenull_ _meta_inline
NetPool* _netqueuePool(_In_opt_
NetQueue* q)
242 return q ? q->pool : NULL;
248_meta_inline uint32 _netLruTick(
void)
254_meta_inline
bool _netqueueShuttingDown(_In_
NetQueue* q)
256 return atomicLoad(uint32, &q->shutdownReq, Acquire) != 0;
273int64 netqueue_pollTimeout(_In_
NetQueue* q, int64 waitUs);
278int64 netqueue_pollTimeoutMsec(_In_
NetQueue* q, int64 waitUs);
288typedef void (*NetResolveCB)(_In_opt_ sa_NetAddr* addrs,
NetErrorCode err, _In_opt_
void* ctx);
293_Check_return_
bool _netResolveSubmit(_In_opt_ strref host, uint16 port, _In_ NetResolveCB cb,
Network address structures.
NetAddrType
Network address types.
intptr NetSockHandle
Platform-neutral OS socket handle: a Windows SOCKET or a Unix file descriptor.
NetErrorCode
Network error codes.
NetSocketType
Socket types.
Thread-safe lazy initialization.
State tracker for lazy initialization.
A single ordering domain: one connection, or one datagram peer.
Per-datagram information the IP layer carries alongside the payload.
Shared, capped pool of network message buffers and headers.
NetQueue manages one or more sockets and a thread pool of workers.