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...
 
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 Pointer Start (AsyncJob *job)
 starts a freshly created job (i.e., makes the job asynchronous) More...
 

Public Attributes

struct sockaddr_un address
 UDS address from path; treat as read-only. More...
 

Protected Member Functions

virtual void timedout ()
 called after setTimeout() if timed out More...
 
virtual void receive (const TypedMsgHdr &message)
 handle IPC message just read More...
 
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...
 
const InstanceId< AsyncJobid
 job identifier More...
 

Private Member Functions

 CBDATA_CLASS (Strand)
 
void registerSelf ()
 
void handleRegistrationResponse (const HereIamMessage &msg)
 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 &)
 

Private Attributes

bool isRegistered
 whether Coordinator ACKed registration (unused) More...
 

Detailed Description

Definition at line 27 of file Strand.h.

Member Typedef Documentation

Definition at line 34 of file AsyncJob.h.

Constructor & Destructor Documentation

Ipc::Strand::Strand ( )

Definition at line 39 of file Strand.cc.

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

Member Function Documentation

void AsyncJob::callEnd ( )
virtualinherited
void AsyncJob::callStart ( AsyncCall call)
inherited
bool AsyncJob::canBeCalled ( AsyncCall call) const
inherited

Definition at line 101 of file AsyncJob.cc.

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

Ipc::Strand::CBDATA_CLASS ( Strand  )
private
void Ipc::UdsOp::clearTimeout ( )
protectedinherited

Definition at line 62 of file UdsOp.cc.

References commUnsetConnTimeout(), and conn.

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

Definition at line 41 of file UdsOp.cc.

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

void AsyncJob::deleteThis ( const char *  aReason)
protectedinherited
void Ipc::Port::doListen ( )
protectedinherited

Definition at line 36 of file Port.cc.

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

bool AsyncJob::done ( ) const
protectedinherited

Definition at line 90 of file AsyncJob.cc.

References AsyncJob::doneAll(), NULL, and AsyncJob::stopReason.

Referenced by AsyncJob::callEnd(), and Downloader::downloadFinished().

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

Reimplemented from AsyncJob.

Definition at line 46 of file Port.cc.

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

Definition at line 142 of file Strand.cc.

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

void Ipc::Strand::handleRegistrationResponse ( const HereIamMessage msg)
private
void Ipc::Strand::handleSnmpRequest ( const Snmp::Request request)
private
void Ipc::Strand::handleSnmpResponse ( const Snmp::Response response)
private

Definition at line 154 of file Strand.cc.

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

String Ipc::Port::MakeAddr ( const char *  proccessLabel,
int  id 
)
staticinherited
Strand& Ipc::Strand::operator= ( const Strand )
private
void Ipc::Strand::registerSelf ( )
private
void Ipc::UdsOp::setOptions ( int  newOptions)
protectedinherited

Definition at line 35 of file UdsOp.cc.

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

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().

void Ipc::Strand::start ( )
virtual

Implements Ipc::Port.

Definition at line 45 of file Strand.cc.

References Ipc::Port::start().

void Ipc::Strand::timedout ( )
protectedvirtual

Reimplemented from Ipc::UdsOp.

Definition at line 161 of file Strand.cc.

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

virtual void* CbdataParent::toCbdata ( )
pure virtualinherited

Member Data Documentation

struct sockaddr_un Ipc::UdsOp::address
inherited

Definition at line 36 of file UdsOp.h.

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

const InstanceId<AsyncJob> AsyncJob::id
protectedinherited

Definition at line 70 of file AsyncJob.h.

AsyncCall::Pointer AsyncJob::inCall
protectedinherited
bool Ipc::Strand::isRegistered
private

Definition at line 51 of file Strand.h.

const char* AsyncJob::stopReason
protectedinherited

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

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors