Skip to content

lwIP (Sockets API) platform

«interface»SolidSyslogStreamLwipSocketTcpStreamLwipSocket

File SolidSyslogLwipSocketTcpStream.h

FileList > Interface > SolidSyslogLwipSocketTcpStream.h

  • #include "SolidSyslogExternC.h"
  • #include "SolidSyslogTcpConnectTimeoutFunction.h"

Classes

Type Name
struct SolidSyslogLwipSocketTcpStreamConfig
Tunes SolidSyslogLwipSocketTcpStream's bounded connect.

Detailed Description

A non-blocking TCP stream over an lwIP Sockets API socket, for a StreamSender or as the byte transport under a TLS stream.

What the stream does through its vtable is the substance:

  • Open takes a socket, makes it non-blocking, and connects: immediate where the stack can answer at once, otherwise a bounded wait up to the config's GetConnectTimeoutMs (re-read each attempt, so a runtime-tunable value applies on the next reconnect), with the deferred result read back afterwards. Every failure closes the socket and reports which step gave up.
  • Send is all-or-nothing and never blocks the service thread: a short write or any error is taken as a dead connection, so the stream closes itself and the sender reconnects on its next pass.
  • Read answers the bytes read, 0 when nothing has arrived (connection kept), or tears the connection down on a peer close or a fault.
  • Version answers 0 for the stream's lifetime: nothing about a plain socket's own configuration moves at runtime.

Coalescing is off and keepalive on, with the idle period taken from SOLIDSYSLOG_TCP_KEEPALIVE_IDLE_SECONDS; a stack built with LWIP_TCP_KEEPALIVE takes the probe interval and count too. An option the stack declines is reported once per Open and the connection still stands.

Public Functions Documentation

SolidSyslogLwipSocketTcpStream_Create

Draw a TCP stream from the pool; the config's GetConnectTimeoutMs bounds the connect.

struct SolidSyslogStream * SolidSyslogLwipSocketTcpStream_Create (
    const struct SolidSyslogLwipSocketTcpStreamConfig * config
) 

An exhausted pool falls back to the shared NullStream.


SolidSyslogLwipSocketTcpStream_Destroy

Release the pool slot and close the socket.

void SolidSyslogLwipSocketTcpStream_Destroy (
    struct SolidSyslogStream * base
) 



The documentation for this class was generated from the following file Platform/LwipSocket/Interface/SolidSyslogLwipSocketTcpStream.h