Skip to content

File SolidSyslogSwitchingSender.h

FileList > Core > Interface > SolidSyslogSwitchingSender.h

Go to the source code of this file

A composite Sender that fronts several inner senders and routes each message through the one the Selector picks — the wiring for dual-SIEM fan-out or an active/standby failover stack. More...

  • #include <stddef.h>
  • #include <stdint.h>
  • #include "ExternC.h"

Classes

Type Name
struct SolidSyslogSwitchingSenderConfig
Wiring for SolidSyslogSwitchingSender_Create, a sender that fronts several inner senders and picks one per message via Selector (dual-SIEM, failover).

Public Types

Type Name
typedef uint8_t(* SolidSyslogSwitchingSenderSelector
Returns the index into Senders of the sender to route the next message through.

Public Functions

Type Name
struct SolidSyslogSender * SolidSyslogSwitchingSender_Create (const struct SolidSyslogSwitchingSenderConfig * config)
Create a switching sender from config .
void SolidSyslogSwitchingSender_Destroy (struct SolidSyslogSender * base)
Release the sender's pool slot.

Detailed Description

The Selector is called on every Send and returns an index into the Senders array; a value at or beyond SenderCount (including any value when the array is empty) routes to the shared NullSender, which drops the message so a misconfigured selector never retains records in the Store. Switching away from a sender disconnects it, so only the currently selected inner sender holds a live connection; the inner senders themselves are caller-owned and are not disconnected or freed on Destroy.

Public Types Documentation

typedef SolidSyslogSwitchingSenderSelector

Returns the index into Senders of the sender to route the next message through.

typedef uint8_t(* SolidSyslogSwitchingSenderSelector) (void);

Called on every Send, so it must be cheap; an index at or beyond SenderCount (including any value when SenderCount is 0) routes to the shared NullSender, which drops the message so a misconfigured selector never retains records in the Store.


Public Functions Documentation

function SolidSyslogSwitchingSender_Create

Create a switching sender from config .

struct SolidSyslogSender * SolidSyslogSwitchingSender_Create (
    const struct SolidSyslogSwitchingSenderConfig * config
) 

Never returns NULL: a NULL or invalid config, or an exhausted sender pool, reports via SolidSyslog_Error and returns the shared NullSender (Send drops on the floor), so the result is safe to wire without a null-check.


function SolidSyslogSwitchingSender_Destroy

Release the sender's pool slot.

void SolidSyslogSwitchingSender_Destroy (
    struct SolidSyslogSender * base
) 

Does not disconnect or free the inner senders; the caller owns those.



The documentation for this class was generated from the following file Core/Interface/SolidSyslogSwitchingSender.h