11#ifndef SQUID_SRC_IPC_UDSOP_H
12#define SQUID_SRC_IPC_UDSOP_H
45 void setTimeout(time_t seconds,
const char *handlerName);
79 void start()
override;
struct msghdr with a known type, fixed-size I/O and control buffers
void setTimeout(time_t seconds, const char *handlerName)
call timedout() if no UDS messages in a given number of seconds
void noteTimeout(const CommTimeoutCbParams &p)
Comm timeout callback; calls timedout()
Comm::ConnectionPointer conn_
UDS descriptor.
UdsOp & operator=(const UdsOp &)
void setOptions(int newOptions)
changes socket options
virtual void timedout()
called after setTimeout() if timed out
void clearTimeout()
remove previously set timeout, if any
Comm::ConnectionPointer & conn()
creates if needed and returns raw UDS socket descriptor
struct sockaddr_un address
UDS address from path; treat as read-only.
attempts to send an IPC message a few times, with a timeout
time_t timeout
total time to send the message
void cancelSleep()
stop sleeping (or do nothing if we were not)
bool writing
whether Comm started and did not finish writing
void start() override
called by AsyncStart; do not call directly
UdsSender(const UdsSender &)
static void DelayedRetry(void *data)
legacy wrapper for Ipc::UdsSender::delayedRetry()
int retries
how many times to try after a write error
void delayedRetry()
make another sending attempt after a pause
void startSleep()
pause for a while before resending the message
void wrote(const CommIoCbParams ¶ms)
done writing or error
void timedout() override
called after setTimeout() if timed out
void write()
schedule writing
bool sleeping
whether we are waiting to retry a failed write
CodeContextPointer codeContext
bool doneAll() const override
whether positive goal has been reached
UdsSender & operator=(const UdsSender &)
TypedMsgHdr message
what to send
FdNoteId
We cannot send char* FD notes to other processes. Pass int IDs and convert.
void SendMessage(const String &toAddress, const TypedMsgHdr &message)
struct sockaddr_un PathToAddress(const String &pathAddr)
converts human-readable filename path into UDS address
const Comm::ConnectionPointer & ImportFdIntoComm(const Comm::ConnectionPointer &conn, int socktype, int protocol, FdNoteId noteId)
import socket fd from another strand into our Comm state