9#ifndef SQUID_SRC_COMM_CONNOPENER_H
10#define SQUID_SRC_COMM_CONNOPENER_H
40 void start()
override;
int totalTries_
total number of connection attempts over all destinations so far.
void timeout(const CommTimeoutCbParams &)
ConnOpener(const ConnOpener &)
Comm::ConnectionPointer conn_
single connection currently to be opened.
void restart()
called at the end of Comm::ConnOpener::DelayedConnectRetry event
static void InProgressConnectRetry(int fd, void *data)
void retrySleep()
Close and wait a little before trying to open and connect again.
struct Comm::ConnOpener::Calls calls_
void cancelSleep()
cleans up this job sleep state
int failRetries_
number of retries current destination has been tried.
CbcPointer< ConnOpener > Pointer
static void DelayedConnectRetry(void *data)
void setHost(const char *)
set the hostname note for this connection
void earlyAbort(const CommCloseCbParams &)
void closeFd()
cleans I/O state and ends I/O for temporaryFd_
time_t deadline_
if we are not done by then, we will call back with Comm::TIMEOUT
void sendAnswer(Comm::Flag errFlag, int xerrno, const char *why)
void start() override
called by AsyncStart; do not call directly
int temporaryFd_
the FD being opened. Do NOT set conn_->fd until it is fully open.
void lookupLocalAddress()
ConnOpener & operator=(const ConnOpener &c)
char * host_
domain name we are trying to connect to.
bool doneAll() const override
whether positive goal has been reached
void keepFd()
cleans I/O state and moves temporaryFd_ to the conn_ for long-term use
void doConnect()
Make an FD connection attempt.
AsyncCall::Pointer callback_
handler to be called on connection completion.
const char * getHost() const
get the hostname noted for this connection
static int connect_timeout
Abstraction layer for TCP, UDP, TLS, UDS and filedescriptor sockets.
handles to calls which we may need to cancel.
AsyncCall::Pointer earlyAbort_
AsyncCall::Pointer timeout_