attempts to send an IPC message a few times, with a timeout More...

#include <UdsOp.h>

Inheritance diagram for Ipc::UdsSender:
Collaboration diagram for Ipc::UdsSender:

Public Types

typedef CbcPointer< AsyncJobPointer

Public Member Functions

 UdsSender (const String &pathAddr, const TypedMsgHdr &aMessage)
bool canBeCalled (AsyncCall &call) const
 whether we can be called More...
void callStart (AsyncCall &call)
virtual void callEnd ()
 called right after the called job method More...
virtual void callException (const std::exception &e)
 called when the job throws during an async call More...
void handleStopRequest ()
 process external request to terminate now (i.e. during this async call) More...
virtual void * toCbdata ()=0

Static Public Member Functions

static void Start (const Pointer &job)
static void RegisterWithCacheManager ()

Public Attributes

CodeContextPointer codeContext
struct sockaddr_un address
 UDS address from path; treat as read-only. More...
const InstanceId< AsyncJobid
 job identifier More...

Protected Member Functions

void swanSong () override
void start () override
 called by AsyncStart; do not call directly More...
bool doneAll () const override
 whether positive goal has been reached More...
void timedout () override
 called after setTimeout() if timed out More...
Comm::ConnectionPointerconn ()
 creates if needed and returns raw UDS socket descriptor More...
void setTimeout (time_t seconds, const char *handlerName)
 call timedout() if no UDS messages in a given number of seconds More...
void clearTimeout ()
 remove previously set timeout, if any More...
void setOptions (int newOptions)
 changes socket options More...
void deleteThis (const char *aReason)
void mustStop (const char *aReason)
bool done () const
 the job is destroyed in callEnd() when done() More...
virtual const char * status () const
 internal cleanup; do not call directly More...

Static Protected Member Functions

static void ReportAllJobs (StoreEntry *)
 writes a cache manager report about all jobs existing in this worker More...

Protected Attributes

const char * stopReason
 reason for forcing done() to be true More...
const char * typeName
 kid (leaf) class name, for debugging More...
AsyncCall::Pointer inCall
 the asynchronous call being handled, if any More...
bool started_ = false
 Start() has finished successfully. More...
bool swanSang_ = false
 swanSong() was called More...

Private Member Functions

void startSleep ()
 pause for a while before resending the message More...
void cancelSleep ()
 stop sleeping (or do nothing if we were not) More...
void delayedRetry ()
 make another sending attempt after a pause More...
void write ()
 schedule writing More...
void wrote (const CommIoCbParams &params)
 done writing or error More...
 UdsSender (const UdsSender &)
UdsSenderoperator= (const UdsSender &)
void noteTimeout (const CommTimeoutCbParams &p)
 Comm timeout callback; calls timedout() More...
virtual void finalizedInCbdataChild ()=0
 hack: ensure CBDATA_CHILD() after a toCbdata()-defining CBDATA_INTERMEDIATE() More...

Static Private Member Functions

static void DelayedRetry (void *data)
 legacy wrapper for Ipc::UdsSender::delayedRetry() More...

Private Attributes

TypedMsgHdr message
 what to send More...
int retries
 how many times to try after a write error More...
time_t timeout
 total time to send the message More...
bool sleeping
 whether we are waiting to retry a failed write More...
bool writing
 whether Comm started and did not finish writing More...
int options
 UDS options. More...
Comm::ConnectionPointer conn_
 UDS descriptor. More...

Detailed Description

Definition at line 68 of file UdsOp.h.

Member Typedef Documentation

◆ Pointer

Definition at line 34 of file AsyncJob.h.

Constructor & Destructor Documentation

◆ UdsSender() [1/2]

Ipc::UdsSender::UdsSender ( const String pathAddr,
const TypedMsgHdr aMessage 

Definition at line 84 of file

References Ipc::TypedMsgHdr::address(), Ipc::UdsOp::address, and message.

◆ UdsSender() [2/2]

Ipc::UdsSender::UdsSender ( const UdsSender )

Member Function Documentation

◆ callEnd()

void AsyncJob::callEnd ( )

◆ callException()

◆ callStart()

void AsyncJob::callStart ( AsyncCall call)

◆ canBeCalled()

bool AsyncJob::canBeCalled ( AsyncCall call) const

Definition at line 117 of file

References AsyncCall::cancel(), debugs, and AsyncJob::inCall.

◆ cancelSleep()

void Ipc::UdsSender::cancelSleep ( )

Definition at line 150 of file

References debugs.


Ipc::UdsSender::CBDATA_CHILD ( UdsSender  )

◆ clearTimeout()

void Ipc::UdsOp::clearTimeout ( )

Definition at line 62 of file

References commUnsetConnTimeout(), and conn.

◆ conn()

Comm::ConnectionPointer & Ipc::UdsOp::conn ( )

Definition at line 41 of file

References COMM_DOBIND, comm_open_uds(), Comm::IsConnOpen(), and Must.

◆ delayedRetry()

void Ipc::UdsSender::delayedRetry ( )

Definition at line 173 of file

References debugs.

◆ DelayedRetry()

void Ipc::UdsSender::DelayedRetry ( void *  data)

Definition at line 160 of file

References assert, and CallBack().

Referenced by startSleep().

◆ deleteThis()

void AsyncJob::deleteThis ( const char *  aReason)

◆ done()

bool AsyncJob::done ( ) const

◆ doneAll()

bool Ipc::UdsSender::doneAll ( ) const

Reimplemented from AsyncJob.

Definition at line 113 of file

References AsyncJob::doneAll().

◆ finalizedInCbdataChild()

virtual void CbdataParent::finalizedInCbdataChild ( )
privatepure virtualinherited

◆ handleStopRequest()

void AsyncJob::handleStopRequest ( )

Definition at line 73 of file AsyncJob.h.

References AsyncJob::mustStop().

◆ mustStop()

◆ noteTimeout()

void Ipc::UdsOp::noteTimeout ( const CommTimeoutCbParams p)

Definition at line 67 of file

Referenced by Ipc::UdsOp::setTimeout().

◆ operator=()

UdsSender & Ipc::UdsSender::operator= ( const UdsSender )

◆ RegisterWithCacheManager()

void AsyncJob::RegisterWithCacheManager ( )

Definition at line 215 of file

References Mgr::RegisterAction(), and AsyncJob::ReportAllJobs().

Referenced by mainInitialize().

◆ ReportAllJobs()

void AsyncJob::ReportAllJobs ( StoreEntry e)

Definition at line 198 of file

References AllJobs().

Referenced by AsyncJob::RegisterWithCacheManager().

◆ setOptions()

void Ipc::UdsOp::setOptions ( int  newOptions)

Definition at line 35 of file

Referenced by Ipc::Port::Port().

◆ setTimeout()

void Ipc::UdsOp::setTimeout ( time_t  seconds,
const char *  handlerName 

Definition at line 54 of file

References asyncCall(), commSetConnTimeout(), conn, handler(), and Ipc::UdsOp::noteTimeout().

◆ start()

void Ipc::UdsSender::start ( )

Reimplemented from AsyncJob.

Definition at line 105 of file

References AsyncJob::start().

◆ Start()

◆ startSleep()

void Ipc::UdsSender::startSleep ( )

Definition at line 140 of file

References DelayedRetry(), eventAdd(), and Must.

◆ status()

◆ swanSong()

void Ipc::UdsSender::swanSong ( )

Reimplemented from AsyncJob.

Definition at line 96 of file

References AsyncJob::swanSong().

◆ timedout()

void Ipc::UdsSender::timedout ( )

Reimplemented from Ipc::UdsOp.

Definition at line 182 of file

References debugs, and MYNAME.

◆ toCbdata()

virtual void * CbdataParent::toCbdata ( )
pure virtualinherited

◆ write()

void Ipc::UdsSender::write ( )

Definition at line 118 of file

References conn, debugs, JobCallback, MYNAME, Comm::Write(), and wrote().

◆ wrote()

void Ipc::UdsSender::wrote ( const CommIoCbParams params)

Definition at line 128 of file

References CommCommonCbParams::conn, conn, debugs, CommCommonCbParams::flag, Comm::OK, and retries.

Referenced by write().

Member Data Documentation

◆ address

struct sockaddr_un Ipc::UdsOp::address

Definition at line 37 of file UdsOp.h.

Referenced by UdsSender().

◆ codeContext

CodeContextPointer Ipc::UdsSender::codeContext

Definition at line 75 of file UdsOp.h.

◆ conn_

Comm::ConnectionPointer Ipc::UdsOp::conn_

Definition at line 56 of file UdsOp.h.

◆ id

const InstanceId<AsyncJob> AsyncJob::id

Definition at line 75 of file AsyncJob.h.

◆ inCall

AsyncCall::Pointer AsyncJob::inCall

◆ message

TypedMsgHdr Ipc::UdsSender::message

Definition at line 93 of file UdsOp.h.

Referenced by UdsSender().

◆ options

int Ipc::UdsOp::options

Definition at line 55 of file UdsOp.h.

◆ retries

int Ipc::UdsSender::retries

Definition at line 94 of file UdsOp.h.

◆ sleeping

bool Ipc::UdsSender::sleeping

Definition at line 96 of file UdsOp.h.

◆ started_

bool AsyncJob::started_ = false

Definition at line 88 of file AsyncJob.h.

Referenced by AsyncJob::~AsyncJob(), AsyncJob::callEnd(), and AsyncJob::Start().

◆ stopReason

const char* AsyncJob::stopReason

◆ swanSang_

bool AsyncJob::swanSang_ = false

Definition at line 89 of file AsyncJob.h.

Referenced by AsyncJob::~AsyncJob(), and AsyncJob::callEnd().

◆ timeout

time_t Ipc::UdsSender::timeout

Definition at line 95 of file UdsOp.h.

◆ typeName

◆ writing

bool Ipc::UdsSender::writing

Definition at line 97 of file UdsOp.h.

The documentation for this class was generated from the following files:






Web Site Translations