File SolidSyslogDatagram.h¶
FileList > Core > Interface > SolidSyslogDatagram.h
Go to the source code of this file
The datagram role: connectionless send of one message to an address (Open / SendTo / Close), with a path-MTU hint (MaxPayload). More...
#include <stdbool.h>#include <stddef.h>#include "ExternC.h"
Public Types¶
| Type | Name |
|---|---|
| enum | SolidSyslogDatagramSendResult |
Public Functions¶
| Type | Name |
|---|---|
| void | SolidSyslogDatagram_Close (struct SolidSyslogDatagram * datagram) Release the transport acquired by Open. |
| size_t | SolidSyslogDatagram_MaxPayload (struct SolidSyslogDatagram * datagram) Largest datagram payload the current path is known to accept, used to trim after an OVERSIZE. |
| bool | SolidSyslogDatagram_Open (struct SolidSyslogDatagram * datagram) Ready the transport for SendTo (acquire the socket). |
| enum SolidSyslogDatagramSendResult | SolidSyslogDatagram_SendTo (struct SolidSyslogDatagram * datagram, const void * buffer, size_t size, const struct SolidSyslogAddress * addr) Send size bytes ofbuffer toaddr as one datagram. |
Detailed Description¶
These calls dispatch to the injected datagram's vtable, so behaviour is that datagram's.
Public Types Documentation¶
enum SolidSyslogDatagramSendResult¶
enum SolidSyslogDatagramSendResult {
SOLIDSYSLOG_DATAGRAM_SEND_RESULT_SENT,
SOLIDSYSLOG_DATAGRAM_SEND_RESULT_OVERSIZE,
SOLIDSYSLOG_DATAGRAM_SEND_RESULT_FAILED
};
Public Functions Documentation¶
function SolidSyslogDatagram_Close¶
Release the transport acquired by Open.
Idempotent; safe on an unopened datagram.
function SolidSyslogDatagram_MaxPayload¶
Largest datagram payload the current path is known to accept, used to trim after an OVERSIZE.
Falls back to SOLIDSYSLOG_UDP_IPV6_SAFE_PAYLOAD (the IPv6-minimum-MTU floor) before a path MTU is known or when the OS cannot report one.
function SolidSyslogDatagram_Open¶
Ready the transport for SendTo (acquire the socket).
Failure leaves the datagram unopened; the sender retries on the next servicing pass.
function SolidSyslogDatagram_SendTo¶
Send size bytes ofbuffer toaddr as one datagram.
enum SolidSyslogDatagramSendResult SolidSyslogDatagram_SendTo (
struct SolidSyslogDatagram * datagram,
const void * buffer,
size_t size,
const struct SolidSyslogAddress * addr
)
addr is borrowed for the call only. A SENT result licenses the sender to drop the record, so a Null datagram returns SENT to discard silently rather than let undeliverables accumulate in the store.
Return value:
SOLIDSYSLOG_DATAGRAM_SEND_RESULT_SENTDelivered to the network.SOLIDSYSLOG_DATAGRAM_SEND_RESULT_OVERSIZEToo large for the path; the sender trims to MaxPayload and retries.SOLIDSYSLOG_DATAGRAM_SEND_RESULT_FAILEDTransient failure; the record is kept.
The documentation for this class was generated from the following file Core/Interface/SolidSyslogDatagram.h