pub struct UnixDatagramTransport { /* private fields */ }Expand description
Write-only Unix datagram transport.
Sends each SyslogMessage as a single datagram to the configured socket
path. This matches the framing expected by rsyslog’s imuxsock datagram
input and by a logfenced instance configured with
listen_transport = "unix_dgram".
The socket is created unbound. On Linux, SHUT_RD is issued immediately
to enforce write-only direction at the OS level; macOS rejects that call on
unconnected sockets, so write-only is type-enforced only on that platform.
There is no framing — the datagram boundary is the message boundary.
Thread-safe: the socket is protected by a tokio::sync::Mutex.
Implementations§
Source§impl UnixDatagramTransport
impl UnixDatagramTransport
Sourcepub fn new(path: impl Into<PathBuf>, max_size: usize) -> Self
pub fn new(path: impl Into<PathBuf>, max_size: usize) -> Self
Create a transport that will send to the Unix datagram socket at path.
max_size is the maximum accepted wire message size in bytes.
Use 65536 for the standard datagram limit.
The default retry limit is 4 attempts. Use max_attempts to change
it.
Sourcepub fn max_attempts(self, n: u32) -> Self
pub fn max_attempts(self, n: u32) -> Self
Set the maximum number of datagram send attempts.
0 means unlimited — retry until the send succeeds or a non-retryable
error occurs. Attempt 1 is immediate; attempt 2 waits 100 µs, and
each subsequent attempt doubles the delay until reaching the 1 s cap.