Receives coordination messages on behalf of its process or thread. More...

#include <Strand.h>

Inheritance diagram for Ipc::Strand:
Collaboration diagram for Ipc::Strand:

Public Types

typedef CbcPointer< AsyncJobPointer
 

Public Member Functions

 Strand ()
 
virtual void start ()
 called by AsyncStart; do not call directly More...
 
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 String MakeAddr (const char *proccessLabel, int id)
 calculates IPC message address for strand id of processLabel type More...
 
static String CoordinatorAddr ()
 get the IPC message address for coordinator process More...
 
static void Start (const Pointer &job)
 

Public Attributes

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

Protected Member Functions

virtual void timedout ()
 called after setTimeout() if timed out More...
 
virtual void receive (const TypedMsgHdr &message)
 
virtual bool doneAll () const
 whether positive goal has been reached More...
 
void doListen ()
 read the next incoming message More...
 
Comm::ConnectionPointerconn ()
 creates if needed and returns raw UDS socket descriptor More...
 
void setTimeout (int 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 void swanSong ()
 
virtual const char * status () const
 internal cleanup; do not call directly 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

 CBDATA_CLASS (Strand)
 
void registerSelf ()
 
void handleRegistrationResponse (const StrandMessage &)
 let Coordinator know this strand exists More...
 
void handleCacheMgrRequest (const Mgr::Request &request)
 
void handleCacheMgrResponse (const Mgr::Response &response)
 
void handleSnmpRequest (const Snmp::Request &request)
 
void handleSnmpResponse (const Snmp::Response &response)
 
 Strand (const Strand &)
 
Strandoperator= (const Strand &)
 
void noteRead (const CommIoCbParams &params)
 
void receiveOrIgnore (const TypedMsgHdr &)
 receive() but ignore any errors More...
 
void noteTimeout (const CommTimeoutCbParams &p)
 Comm timeout callback; calls timedout() More...
 

Private Attributes

bool isRegistered
 whether Coordinator ACKed registration (unused) More...
 
TypedMsgHdr buf
 msghdr struct filled by Comm More...
 
int options
 UDS options. More...
 
Comm::ConnectionPointer conn_
 UDS descriptor. More...
 

Detailed Description

Definition at line 27 of file Strand.h.

Member Typedef Documentation

◆ Pointer

Definition at line 34 of file AsyncJob.h.

Constructor & Destructor Documentation

◆ Strand() [1/2]

Ipc::Strand::Strand ( )

Definition at line 40 of file Strand.cc.

◆ Strand() [2/2]

Ipc::Strand::Strand ( const Strand )
private

Member Function Documentation

◆ callEnd()

void AsyncJob::callEnd ( )
virtualinherited

◆ callException()

◆ callStart()

void AsyncJob::callStart ( AsyncCall call)
inherited

◆ canBeCalled()

bool AsyncJob::canBeCalled ( AsyncCall call) const
inherited

Definition at line 102 of file AsyncJob.cc.

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

◆ CBDATA_CLASS()

Ipc::Strand::CBDATA_CLASS ( Strand  )
private

◆ clearTimeout()

void Ipc::UdsOp::clearTimeout ( )
protectedinherited

Definition at line 62 of file UdsOp.cc.

References commUnsetConnTimeout(), and conn.

◆ conn()

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

Definition at line 41 of file UdsOp.cc.

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

◆ CoordinatorAddr()

◆ deleteThis()

void AsyncJob::deleteThis ( const char *  aReason)
protectedinherited

◆ doListen()

void Ipc::Port::doListen ( )
protectedinherited

Definition at line 37 of file Port.cc.

References comm_read(), conn, debugs, HERE(), JobCallback, and Ipc::Port::noteRead().

◆ done()

bool AsyncJob::done ( ) const
protectedinherited

◆ doneAll()

bool Ipc::Port::doneAll ( ) const
protectedvirtualinherited

Reimplemented from AsyncJob.

Definition at line 47 of file Port.cc.

◆ handleCacheMgrRequest()

void Ipc::Strand::handleCacheMgrRequest ( const Mgr::Request request)
private

◆ handleCacheMgrResponse()

void Ipc::Strand::handleCacheMgrResponse ( const Mgr::Response response)
private

Definition at line 140 of file Strand.cc.

References Ipc::Forwarder::HandleRemoteAck(), and Ipc::Response::requestId.

◆ handleRegistrationResponse()

void Ipc::Strand::handleRegistrationResponse ( const StrandMessage msg)
private

◆ handleSnmpRequest()

void Ipc::Strand::handleSnmpRequest ( const Snmp::Request request)
private

Definition at line 146 of file Strand.cc.

References debugs, HERE(), request(), and Snmp::SendResponse().

◆ handleSnmpResponse()

void Ipc::Strand::handleSnmpResponse ( const Snmp::Response response)
private

Definition at line 152 of file Strand.cc.

References debugs, Ipc::Forwarder::HandleRemoteAck(), HERE(), and Ipc::Response::requestId.

◆ handleStopRequest()

void AsyncJob::handleStopRequest ( )
inlineinherited

Definition at line 71 of file AsyncJob.h.

References AsyncJob::mustStop().

◆ MakeAddr()

String Ipc::Port::MakeAddr ( const char *  proccessLabel,
int  id 
)
staticinherited

◆ mustStop()

◆ noteRead()

void Ipc::Port::noteRead ( const CommIoCbParams params)
privateinherited

◆ noteTimeout()

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

Definition at line 67 of file UdsOp.cc.

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

◆ operator=()

Strand& Ipc::Strand::operator= ( const Strand )
private

◆ receive()

◆ receiveOrIgnore()

void Ipc::Port::receiveOrIgnore ( const TypedMsgHdr message)
privateinherited

◆ registerSelf()

void Ipc::Strand::registerSelf ( )
private

◆ setOptions()

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

Definition at line 35 of file UdsOp.cc.

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

◆ setTimeout()

void Ipc::UdsOp::setTimeout ( int  seconds,
const char *  handlerName 
)
protectedinherited

Definition at line 54 of file UdsOp.cc.

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

◆ start()

void Ipc::Strand::start ( )
virtual

Implements Ipc::Port.

Definition at line 46 of file Strand.cc.

References Ipc::Port::start().

◆ Start()

◆ status()

◆ swanSong()

◆ timedout()

void Ipc::Strand::timedout ( )
protectedvirtual

Reimplemented from Ipc::UdsOp.

Definition at line 159 of file Strand.cc.

References debugs, fatalf(), HERE(), and KidIdentifier.

◆ toCbdata()

virtual void* CbdataParent::toCbdata ( )
pure virtualinherited

Member Data Documentation

◆ address

struct sockaddr_un Ipc::UdsOp::address
inherited

Definition at line 34 of file UdsOp.h.

Referenced by Ipc::UdsSender::UdsSender().

◆ buf

TypedMsgHdr Ipc::Port::buf
privateinherited

Definition at line 47 of file Port.h.

◆ conn_

Comm::ConnectionPointer Ipc::UdsOp::conn_
privateinherited

Definition at line 56 of file UdsOp.h.

◆ id

const InstanceId<AsyncJob> AsyncJob::id
inherited

Definition at line 73 of file AsyncJob.h.

◆ inCall

AsyncCall::Pointer AsyncJob::inCall
protectedinherited

◆ isRegistered

bool Ipc::Strand::isRegistered
private

Definition at line 51 of file Strand.h.

◆ options

int Ipc::UdsOp::options
privateinherited

Definition at line 55 of file UdsOp.h.

◆ started_

bool AsyncJob::started_ = false
protectedinherited

Definition at line 83 of file AsyncJob.h.

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

◆ stopReason

const char* AsyncJob::stopReason
protectedinherited

◆ swanSang_

bool AsyncJob::swanSang_ = false
protectedinherited

Definition at line 84 of file AsyncJob.h.

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

◆ typeName


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

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors