BaseRpc Class Reference

#include <BaseRpc.h>

Inheritance diagram for BaseRpc:

RpcListener BaseApp BaseOverlay BootstrapList DHT DHTTestApp GIASearchApp I3 KBRTestApp P2pns RealWorldTestApp Scribe SimMud SimpleGameClient TierDummy XmlRpcInterface BasePastry Broose Chord Gia Kademlia OverlayDummy PubSubLobby PubSubMMOG Vast

List of all members.


Detailed Description

Base class for RPCs.

Base class for RPCs.

Author:
Bernhard Heep (initial)

Sebastian Mies (rpc, lookup)

Gregoire Menuel (separation from BaseRpc)


Public Member Functions

 BaseRpc ()
const NodeHandlegetThisNode ()
 Returns the NodeHandle of this node.

Protected Member Functions

virtual bool internalHandleRpc (BaseCallMessage *msg)
 Handles internal rpc requests.
virtual bool internalHandleRpcResponse (BaseResponseMessage *msg, cPolymorphic *context, int rpcId, simtime_t rtt)
 Handles rpc responses internal in base classes
.
virtual void internalHandleRpcTimeout (BaseCallMessage *msg, const TransportAddress &dest, cPolymorphic *context, int rpcId, const OverlayKey &destKey)
 Handles rpc timeouts internal in base classes
.
void initRpcs ()
 Initializes Remote-Procedure state.
void finishRpcs ()
 Deinitializes Remote-Procedure state.
virtual void internalHandleRpcMessage (BaseRpcMessage *msg)
 Handles incoming rpc messages and delegates them to the corresponsing listeners or handlers.
uint32_t sendRouteRpcCall (CompType destComp, const TransportAddress &dest, const OverlayKey &destKey, BaseCallMessage *msg, cPolymorphic *context=NULL, RoutingType routingType=DEFAULT_ROUTING, simtime_t timeout=-1, int retries=0, int rpcId=-1, RpcListener *rpcListener=NULL)
 Routes a Remote-Procedure-Call message to an OverlayKey.
uint32_t sendRouteRpcCall (CompType destComp, const OverlayKey &destKey, BaseCallMessage *msg, cPolymorphic *context=NULL, RoutingType routingType=DEFAULT_ROUTING, simtime_t timeout=-1, int retries=0, int rpcId=-1, RpcListener *rpcListener=NULL)
 Routes a Remote-Procedure-Call message to an OverlayKey.
uint32_t sendRouteRpcCall (CompType destComp, const TransportAddress &dest, BaseCallMessage *msg, cPolymorphic *context=NULL, RoutingType routingType=DEFAULT_ROUTING, simtime_t timeout=-1, int retries=0, int rpcId=-1, RpcListener *rpcListener=NULL)
 Sends a Remote-Procedure-Call message using the overlay's UDP port
This replaces ROUTE_DIRECT calls!
uint32_t sendUdpRpcCall (const TransportAddress &dest, BaseCallMessage *msg, cPolymorphic *context=NULL, simtime_t timeout=-1, int retries=0, int rpcId=-1, RpcListener *rpcListener=NULL)
 Sends a Remote-Procedure-Call message to the underlay
.
uint32_t sendInternalRpcCall (CompType destComp, BaseCallMessage *msg, cPolymorphic *context=NULL, simtime_t timeout=-1, int retries=0, int rpcId=-1, RpcListener *rpcListener=NULL)
 Sends an internal Remote-Procedure-Call between two tiers
.
void cancelRpcMessage (uint32_t nonce)
 Cancels a Remote-Procedure-Call.
void sendRpcResponse (TransportType transportType, CompType destComp, const TransportAddress &dest, const OverlayKey &destKey, BaseCallMessage *call, BaseResponseMessage *response)
 Send Remote-Procedure response message and deletes call message.
void sendRpcResponse (BaseCallMessage *call, BaseResponseMessage *response)
 Send Remote-Procedure response message to UDP and deletes call message.
void pingNode (const TransportAddress &dest, simtime_t timeout=-1, int retries=0, cPolymorphic *context=NULL, const char *caption="PING", RpcListener *rpcListener=NULL, int rpcId=-1, TransportType transportType=INVALID_TRANSPORT, bool overrideCache=false)
 ping a node by its TransportAddress
virtual bool handleRpc (BaseCallMessage *msg)
 Processes Remote-Procedure-Call invokation messages.
virtual CompType getThisCompType ()=0
 Return the component type of this module.
virtual void sendMessageToUDP (const TransportAddress &addr, cMessage *message)
virtual void pingResponse (PingResponse *pingResponse, cPolymorphic *context, int rpcId, simtime_t rtt)
virtual void pingTimeout (PingCall *pingCall, const TransportAddress &dest, cPolymorphic *context, int rpcId)

Protected Attributes

NodeHandle thisNode
 NodeHandle to this node.
BaseOverlayoverlay
bool debugOutput
 debug output ?
GlobalParametersglobalParameters
 pointer to the GlobalParameters module
GlobalStatisticsglobalStatistics
 pointer to GlobalStatistics module in this node
CompType thisCompType
NeighborCacheneighborCache
int numPingSent
int bytesPingSent
int numPingResponseSent
int bytesPingResponseSent

Private Types

typedef UNORDERED_MAP< int,
RpcState
RpcStates

Private Member Functions

uint32_t sendRpcCall (TransportType transportType, CompType destComp, const TransportAddress &dest, const OverlayKey &destKey, BaseCallMessage *msg, cPolymorphic *context, RoutingType routingType, simtime_t timeout, int retries, int rpcId, RpcListener *rpcListener)
 Sends a Remote-Procedure-Call message to the underlay.
void sendRpcMessageWithTransport (TransportType transportType, CompType destComp, RoutingType routingType, const std::vector< TransportAddress > &sourceRoute, const OverlayKey &destKey, BaseRpcMessage *message)
virtual void internalSendRouteRpc (BaseRpcMessage *message, const OverlayKey &destKey, const std::vector< TransportAddress > &sourceRoute, RoutingType routingType)=0
virtual void internalSendRpcResponse (BaseCallMessage *call, BaseResponseMessage *response)=0
void pingRpc (PingCall *call)
void pingRpcResponse (PingResponse *response, cPolymorphic *context, int rpcId, simtime_t rtt)
void pingRpcTimeout (PingCall *pingCall, const TransportAddress &dest, cPolymorphic *context, int rpcId)

Private Attributes

int rpcsPending
RpcListenerdefaultRpcListener
RpcStates rpcStates
double rpcUdpTimeout
double rpcKeyTimeout

Classes

class  RpcState

Member Typedef Documentation

typedef UNORDERED_MAP<int,RpcState> BaseRpc::RpcStates [private]


Constructor & Destructor Documentation

BaseRpc::BaseRpc (  ) 

00049 {
00050     defaultRpcListener = NULL;
00051 }


Member Function Documentation

const NodeHandle& BaseRpc::getThisNode (  )  [inline]

Returns the NodeHandle of this node.

Returns:
the NodeHandle of this node.

Referenced by Scribe::addChildToGroup(), BaseApp::callRoute(), Scribe::checkGroupEmpty(), RealWorldTestApp::deliver(), KBRTestApp::deliver(), Scribe::deliverALMDataToGroup(), ConnectivityProbe::extractTopology(), Scribe::forward(), KBRTestApp::forward(), BootstrapList::getBootstrapNode(), Kademlia::handleBucketRefreshTimerExpired(), BaseApp::handleCommonAPIMessage(), Scribe::handleJoinMessage(), Scribe::handleJoinResponse(), KBRTestApp::handleLookupResponse(), DHT::handleLookupResponse(), BootstrapList::handleLookupResponse(), GIASearchApp::handleLowerMessage(), XmlRpcInterface::handleMessage(), BaseApp::handleMessage(), SimMud::handleMove(), SimMud::handleOtherPlayerMove(), Scribe::handlePublishCall(), Scribe::handlePublishResponse(), DHT::handlePutRequest(), IterativePathLookup::handleResponse(), Scribe::handleRpcResponse(), KBRTestApp::handleRpcResponse(), BootstrapList::handleRpcResponse(), SimpleGameClient::handleTimerEvent(), Scribe::handleTimerEvent(), GIASearchApp::handleTimerEvent(), DHT::handleTimerEvent(), Scribe::handleUpperMessage(), BaseOverlay::isMalicious(), IterativeLookup::lookup(), P2pns::p2pnsRegisterRpc(), BootstrapList::pingResponse(), BootstrapList::pingTimeout(), Kademlia::routingAdd(), Kademlia::routingBucketIndex(), BaseApp::sendMessageToUDP(), sendRpcCall(), sendRpcResponse(), BaseOverlay::setOverlayReady(), IterativeLookup::start(), Scribe::subscribeToGroup(), Scribe::update(), and DHT::update().

00063 { return thisNode; };

bool BaseRpc::internalHandleRpc ( BaseCallMessage *  msg  )  [protected, virtual]

Handles internal rpc requests.


This method is used to implement basic functionionality in the BaseRpc.

Parameters:
msg The call message
Returns:
bool true, if call has been handled.

Reimplemented in BaseApp, and BaseOverlay.

Referenced by BaseOverlay::internalHandleRpc(), BaseApp::internalHandleRpc(), and internalHandleRpcMessage().

00330 {
00331     RPC_SWITCH_START( msg );
00332     RPC_DELEGATE( Ping, pingRpc );
00333     RPC_SWITCH_END( );
00334 
00335     return RPC_HANDLED;
00336 }

bool BaseRpc::internalHandleRpcResponse ( BaseResponseMessage *  msg,
cPolymorphic *  context,
int  rpcId,
simtime_t  rtt 
) [protected, virtual]

Handles rpc responses internal in base classes
.

This method is used to implement basic functionionality in the BaseRpc.

Parameters:
msg The call message
context Pointer to an optional state object. The object has to be handled/deleted by the internalHandleRpcResponse() code
rpcId The ID of the call
rtt the time between sending the call and receiving the response
Returns:
bool true, if call has been handled.

Reimplemented in BaseApp, and BaseOverlay.

Referenced by internalHandleRpcMessage(), BaseOverlay::internalHandleRpcResponse(), and BaseApp::internalHandleRpcResponse().

00341 {
00342     // call rpc stubs
00343     RPC_SWITCH_START( msg );
00344     RPC_ON_RESPONSE( Ping ) {
00345         pingRpcResponse(_PingResponse, context, rpcId, rtt);
00346     }
00347     RPC_SWITCH_END( );
00348 
00349     return RPC_HANDLED; //TODO always false
00350 }

void BaseRpc::internalHandleRpcTimeout ( BaseCallMessage *  msg,
const TransportAddress dest,
cPolymorphic *  context,
int  rpcId,
const OverlayKey destKey 
) [protected, virtual]

Handles rpc timeouts internal in base classes
.

This method is used to implement basic functionality in the BaseRpc.

Parameters:
msg The call message
dest The node that did not response
context Pointer to an optional state object. The object has to be handled/deleted by the internalHandleRpcResponse() code
rpcId The ID of the call
destKey The key of the call if used
Returns:
bool true, if call has been handled.
Todo:
return bool?

Reimplemented in BaseOverlay.

Referenced by internalHandleRpcMessage(), and BaseOverlay::internalHandleRpcTimeout().

00356 {
00357     RPC_SWITCH_START( msg ) {
00358         RPC_ON_CALL( Ping ) {
00359             pingRpcTimeout(_PingCall, dest, context, rpcId);
00360         }
00361     }
00362     RPC_SWITCH_END( )
00363 }

void BaseRpc::initRpcs (  )  [protected]

Initializes Remote-Procedure state.

Referenced by BaseOverlay::initialize(), BaseApp::initialize(), and DHTTestApp::initializeApp().

00055 {
00056     // set friend modules
00057     globalStatistics = GlobalStatisticsAccess().get();
00058     globalParameters = GlobalParametersAccess().get();
00059 
00060     rpcsPending = 0;
00061     rpcStates.clear();
00062 
00063     defaultRpcListener = new RpcListener();
00064 
00065     //set ping cache
00066     numPingSent = 0;
00067     bytesPingSent = 0;
00068     numPingResponseSent = 0;
00069     bytesPingResponseSent = 0;
00070 
00071     WATCH(numPingSent);
00072     WATCH(bytesPingSent);
00073     WATCH(numPingResponseSent);
00074     WATCH(bytesPingResponseSent);
00075 
00076     // set overlay pointer
00077     overlay = OverlayAccess().get(this);
00078 
00079     // register component
00080     thisCompType = getThisCompType();
00081     overlay->registerComp(thisCompType, this);
00082 
00083     cModule *mod = parentModule();
00084     neighborCache = NULL;
00085     while (neighborCache == NULL) {
00086         neighborCache = (NeighborCache*)mod->submodule("neighborCache");
00087         mod = mod->parentModule();
00088         if (!mod)
00089             opp_error ("BaseRpc::initRpc: Module type contains no ping cache!");
00090     }
00091 }

void BaseRpc::finishRpcs (  )  [protected]

Deinitializes Remote-Procedure state.

Referenced by BaseApp::~BaseApp(), and BaseOverlay::~BaseOverlay().

00095 {
00096     // stop all rpcs
00097     for (RpcStates::iterator i = rpcStates.begin();
00098         i != rpcStates.end(); i++) {
00099         cancelAndDelete(i->second.callMsg);
00100         cancelAndDelete(i->second.timeoutMsg);
00101         delete i->second.dest;
00102         i->second.dest = NULL;
00103         delete i->second.context;
00104         i->second.context = NULL;
00105     }
00106     rpcStates.clear();
00107 
00108     // delete default rpc listener
00109     if (defaultRpcListener != NULL) {
00110         delete defaultRpcListener;
00111         defaultRpcListener = NULL;
00112     }
00113 }

void BaseRpc::internalHandleRpcMessage ( BaseRpcMessage *  msg  )  [protected, virtual]

Handles incoming rpc messages and delegates them to the corresponsing listeners or handlers.

Parameters:
msg The message to handle.

Referenced by BaseOverlay::handleBaseOverlayMessage(), BaseApp::handleCommonAPIMessage(), XmlRpcInterface::handleMessage(), BaseOverlay::handleMessage(), and BaseApp::handleMessage().

00221 {
00222     // check if this is a rpc call message
00223     BaseCallMessage* rpCall = dynamic_cast<BaseCallMessage*>(msg);
00224     if (rpCall != NULL) {
00225         bool rpcHandled = true;
00226         if (!handleRpc(rpCall)) rpcHandled = internalHandleRpc(rpCall);
00227         if (!rpcHandled) {
00228             EV << "[BaseRpc::internalHandleRpcMessage() @ " << thisNode.ip
00229                << " (" << thisNode.key.toString(16) << ")]\n"
00230                << "    Error: RPC '" << msg->fullName()<< "' was not handled"
00231                << endl;
00232             delete msg;
00233         }
00234         return;
00235     }
00236 
00237     // get nonce
00238     int nonce = msg->getNonce();
00239 
00240     // nonce known? no -> delete message and return
00241     if (rpcStates.count(nonce)==0) {
00242         EV << "[BaseRpc::internalHandleRpcMessage() @ " << thisNode.ip
00243            << " " << thisNode.key.toString(16) << ")]\n"
00244            << "    RPC: Nonce Unknown"
00245            << endl;
00246         delete msg;
00247         return;
00248     }
00249 
00250     // get state and remove from map
00251     RpcState state = rpcStates[nonce];
00252     rpcStates.erase(nonce);
00253 
00254     // is timeout message?
00255     if (msg->isSelfMessage() &&
00256         (dynamic_cast<RpcTimeoutMessage*>(msg) != NULL)) {
00257         // yes-> inform listener
00258 
00259         // retry?
00260         state.retries--;
00261         simtime_t timeout = simulation.simTime() - state.timeSent;
00262         if (state.retries>=0) {
00263             //TODO
00264             std::vector<TransportAddress> sourceRoute;
00265             sourceRoute.push_back(*state.dest);
00266             sendRpcMessageWithTransport(state.transportType, state.destComp,
00267                                         state.routingType,
00268                                         sourceRoute,
00269                                         state.destKey,
00270                                         dynamic_cast<BaseCallMessage*>
00271                                         (state.callMsg->dup()));
00272             if (timeout!=0)
00273                 scheduleAt(simulation.simTime() + timeout, msg);
00274 
00275             state.timeSent = simulation.simTime();
00276             rpcStates[nonce] = state;
00277             return;
00278         }
00279         // inform listener
00280         if (state.listener != NULL)
00281             state.listener->handleRpcTimeout(state.callMsg, *state.dest,
00282                                              state.context, state.id,
00283                                              state.destKey);
00284 
00285         // inform overlay
00286         internalHandleRpcTimeout(state.callMsg, *state.dest, state.context,
00287                                  state.id, state.destKey);
00288         handleRpcTimeout(state.callMsg, *state.dest, state.context,
00289                          state.id, state.destKey);
00290 
00291     } else { // no-> handle rpc response
00292 
00293         // get parameters
00294         simtime_t rtt = simulation.simTime() - state.timeSent;
00295         BaseResponseMessage* response
00296             = dynamic_cast<BaseResponseMessage*>(msg);
00297 
00298         //if (state.transportType == UDP_TRANSPORT)
00299         //    globalStatistics->recordOutVector("BaseRpc: UDP Round Trip Time",
00300         //                                      rtt);
00301 
00302         // inform listener
00303         if (state.listener != NULL)
00304             state.listener->handleRpcResponse(response, state.context,
00305                                               state.id, rtt);
00306 
00307         // inform overlay
00308         internalHandleRpcResponse(response, state.context, state.id, rtt);
00309         handleRpcResponse(response, state.context, state.id, rtt);
00310 
00311         // delete response
00312         delete response->removeControlInfo();
00313         delete response;
00314     }
00315 
00316     // delete messages
00317     delete state.callMsg;
00318     cancelAndDelete(state.timeoutMsg);
00319     delete state.dest;
00320 
00321     // clean up pointers
00322     state.dest = NULL;
00323     state.context = NULL;
00324     state.callMsg = NULL;
00325     state.timeoutMsg = NULL;
00326 }

uint32_t BaseRpc::sendRouteRpcCall ( CompType  destComp,
const TransportAddress dest,
const OverlayKey destKey,
BaseCallMessage *  msg,
cPolymorphic *  context = NULL,
RoutingType  routingType = DEFAULT_ROUTING,
simtime_t  timeout = -1,
int  retries = 0,
int  rpcId = -1,
RpcListener rpcListener = NULL 
) [inline, protected]

Routes a Remote-Procedure-Call message to an OverlayKey.


If no timeout is provided, a default value of globalParameters.rpcUdpTimeout for underlay and globalParameters.rpcKeyTimeout for a overlay rpc is used. After a timeout the message gets retransmitted for at maximum retries times. The destKey attribute is kept untouched.

Parameters:
destComp The destination component
dest Destination node handle (if specified, used as first hop)
destKey Destination OverlayKey (if unspecified, the message will be sent to dest using the overlay's UDP port)
msg RPC Call Message
context a pointer to an arbitrary cPolymorphic object, which can be used to store additional state
routingType KBR routing type
timeout RPC timeout
retries How often we try to resent rpc call, if it gets lost
rpcId RPC id
rpcListener RPC Listener
Returns:
The nonce of the RPC

Referenced by Scribe::deliverALMDataToRoot(), Koorde::handleDeBruijnTimerExpired(), Chord::handleFixFingersTimerExpired(), DHT::handleGetResponse(), Scribe::handleJoinMessage(), Chord::handleJoinTimerExpired(), Broose::handleJoinTimerExpired(), DHT::handleLookupResponse(), DHT::handleRpcTimeout(), Scribe::handleTimerEvent(), Chord::joinForeignPartition(), RecursiveLookup::lookup(), pingNode(), Scribe::subscribeToGroup(), Scribe::update(), and DHT::update().

00182     {
00183         if (dest.isUnspecified() && destKey.isUnspecified())
00184             opp_error("BaseRpc::sendRouteRpcCall() with both key and "
00185                       "transportAddress unspecified!");
00186         return sendRpcCall(ROUTE_TRANSPORT, destComp, dest, destKey, msg,
00187                            context, routingType, timeout, retries,
00188                            rpcId, rpcListener);
00189     }

uint32_t BaseRpc::sendRouteRpcCall ( CompType  destComp,
const OverlayKey destKey,
BaseCallMessage *  msg,
cPolymorphic *  context = NULL,
RoutingType  routingType = DEFAULT_ROUTING,
simtime_t  timeout = -1,
int  retries = 0,
int  rpcId = -1,
RpcListener rpcListener = NULL 
) [inline, protected]

Routes a Remote-Procedure-Call message to an OverlayKey.


If no timeout is provided, a default value of globalParameters.rpcUdpTimeout for underlay and globalParameters.rpcKeyTimeout for a overlay rpc is used. After a timeout the message gets retransmitted for at maximum retries times. The destKey attribute is kept untouched.

Parameters:
destComp The destination component
destKey Destination OverlayKey
msg RPC Call Message
context a pointer to an arbitrary cPolymorphic object, which can be used to store additional state
routingType KBR routing type
timeout RPC timeout
retries How often we try to resent rpc call, if it gets lost
rpcId RPC id
rpcListener RPC Listener
Returns:
The nonce of the RPC
00222     {
00223         return sendRpcCall(ROUTE_TRANSPORT, destComp,
00224                            TransportAddress::UNSPECIFIED_NODE,
00225                            destKey, msg, context, routingType, timeout,
00226                            retries, rpcId, rpcListener);
00227     }

uint32_t BaseRpc::sendRouteRpcCall ( CompType  destComp,
const TransportAddress dest,
BaseCallMessage *  msg,
cPolymorphic *  context = NULL,
RoutingType  routingType = DEFAULT_ROUTING,
simtime_t  timeout = -1,
int  retries = 0,
int  rpcId = -1,
RpcListener rpcListener = NULL 
) [inline, protected]

Sends a Remote-Procedure-Call message using the overlay's UDP port
This replaces ROUTE_DIRECT calls!

If no timeout is provided, a default value of globalParameters.rpcUdpTimeout for underlay and globalParameters.rpcKeyTimeout for a overlay rpc is used. After a timeout the message gets retransmitted for at maximum retries times. The destKey attribute is kept untouched.

Parameters:
destComp The destination component
dest Destination node handle
msg RPC Call Message
context a pointer to an arbitrary cPolymorphic object, which can be used to store additional state
routingType KBR routing type
timeout RPC timeout
retries How often we try to resent rpc call, if it gets lost
rpcId RPC id
rpcListener RPC Listener
Returns:
The nonce of the RPC
00261     {
00262         return sendRpcCall(ROUTE_TRANSPORT, destComp, dest,
00263                            OverlayKey::UNSPECIFIED_KEY, msg, context,
00264                            routingType, timeout, retries, rpcId, rpcListener);
00265     }

uint32_t BaseRpc::sendUdpRpcCall ( const TransportAddress dest,
BaseCallMessage *  msg,
cPolymorphic *  context = NULL,
simtime_t  timeout = -1,
int  retries = 0,
int  rpcId = -1,
RpcListener rpcListener = NULL 
) [inline, protected]

Sends a Remote-Procedure-Call message to the underlay
.

If no timeout is provided, a default value of globalParameters.rpcUdpTimeout for underlay and globalParameters.rpcKeyTimeout for a overlay rpc is used. After a timeout the message gets retransmitted for at maximum retries times. The destKey attribute is kept untouched.

Parameters:
dest Destination node handle
msg RPC Call Message
context a pointer to an arbitrary cPolymorphic object, which can be used to store additional state
timeout RPC timeout
retries How often we try to resent rpc call, if it gets lost
rpcId RPC id
rpcListener RPC Listener
Returns:
The nonce of the RPC

Referenced by Broose::changeState(), PubSubMMOG::handleAppMessage(), PubSubMMOG::handleBackupCallTimeout(), Broose::handleBucketTimerExpired(), PubSubMMOG::handleHelpResponse(), PubSubMMOG::handleIntermediateResponse(), PubSubLobby::handleJoin(), PubSubMMOG::handleJoinResponse(), PubSubMMOG::handleMove(), Chord::handleNewSuccessorHint(), PubSubMMOG::handlePingCallTimeout(), PubSubLobby::handleRespCall(), PubSubMMOG::handleResponsibleNodeResponse(), Chord::handleRpcNotifyResponse(), Koorde::handleRpcStabilizeResponse(), Chord::handleRpcStabilizeResponse(), Chord::handleStabilizeTimerExpired(), PubSubMMOG::handleSubscriptionCall(), PubSubMMOG::handleSubscriptionCallTimeout(), IterativePathLookup::handleTimeout(), pingNode(), PubSubMMOG::sendMessageToChildren(), BaseOverlay::sendRouteMessage(), IterativeLookup::sendRpc(), PubSubMMOG::takeOverSubspace(), and PubSubMMOG::unsubscribeChild().

00293     {
00294         return sendRpcCall(UDP_TRANSPORT, INVALID_COMP, dest,
00295                            OverlayKey::UNSPECIFIED_KEY, msg, context,
00296                            NO_OVERLAY_ROUTING, timeout, retries, rpcId,
00297                            rpcListener);
00298     }

uint32_t BaseRpc::sendInternalRpcCall ( CompType  destComp,
BaseCallMessage *  msg,
cPolymorphic *  context = NULL,
simtime_t  timeout = -1,
int  retries = 0,
int  rpcId = -1,
RpcListener rpcListener = NULL 
) [inline, protected]

Sends an internal Remote-Procedure-Call between two tiers
.

If no timeout is provided, a default value of globalParameters.rpcUdpTimeout for underlay and globalParameters.rpcKeyTimeout for a overlay rpc is used. After a timeout the message gets retransmitted for at maximum retries times. The destKey attribute is kept untouched.

Parameters:
destComp Destination component
msg RPC Call Message
context a pointer to an arbitrary cPolymorphic object, which can be used to store additional state
timeout RPC timeout
retries How often we try to resent rpc call, if it gets lost
rpcId RPC id
rpcListener RPC Listener
Returns:
The nonce of the RPC

Referenced by P2pns::handleDHTgetCAPIResponse(), DHT::handleGetCAPIRequest(), DHT::handlePutCAPIRequest(), KBRTestApp::handleTimerEvent(), DHTTestApp::handleTimerEvent(), DHTTestApp::handleTraceMessage(), BootstrapList::locateBootstrapNode(), P2pns::p2pnsRegisterRpc(), P2pns::p2pnsResolveRpc(), XmlRpcInterface::sendInternalRpcWithTimeout(), and DHT::update().

00327     {
00328         return sendRpcCall(INTERNAL_TRANSPORT, destComp,
00329                            TransportAddress::UNSPECIFIED_NODE,
00330                            OverlayKey::UNSPECIFIED_KEY, msg, context,
00331                            NO_OVERLAY_ROUTING, timeout, retries, rpcId,
00332                            rpcListener);
00333     }

void BaseRpc::cancelRpcMessage ( uint32_t  nonce  )  [protected]

Cancels a Remote-Procedure-Call.

Parameters:
nonce The nonce of the RPC

Referenced by RecursiveLookup::abortLookup(), XmlRpcInterface::resetConnectionState(), and IterativeLookup::stop().

00206 {
00207     if (rpcStates.count(nonce)==0)
00208         return;
00209     RpcState state = rpcStates[nonce];
00210     rpcStates.erase(nonce);
00211     cancelAndDelete(state.callMsg);
00212     cancelAndDelete(state.timeoutMsg);
00213     delete state.dest;
00214     state.dest = NULL;
00215     delete state.context;
00216     state.context = NULL;
00217 }

void BaseRpc::sendRpcResponse ( TransportType  transportType,
CompType  destComp,
const TransportAddress dest,
const OverlayKey destKey,
BaseCallMessage *  call,
BaseResponseMessage *  response 
) [protected]

Send Remote-Procedure response message and deletes call message.

Parameters:
transportType The transport used for this RPC
destComp Destination component
dest The TransportAddress of the destination (hint for ROUTE_TRANSPORT)
destKey The destination key for a ROUTE_TRANSPORT
call The corresponding call message to the reponse
response The response message

Referenced by BaseOverlay::failedNodeRpc(), BaseOverlay::findNodeRpc(), PubSubMMOG::handleAdoptChildCall(), PubSubMMOG::handleBackupCall(), Broose::handleBroosePingRequestRpc(), Broose::handleBucketRequestRpc(), P2pns::handleDHTgetCAPIResponse(), P2pns::handleDHTputCAPIResponse(), DHT::handleDumpDhtRequest(), DHT::handleGetRequest(), DHT::handleGetResponse(), PubSubLobby::handleHelpCall(), PubSubMMOG::handleIntermediateCall(), PubSubLobby::handleJoin(), Scribe::handleJoinMessage(), P2pns::handleLookupResponse(), DHT::handleLookupResponse(), PubSubMMOG::handlePingCall(), Scribe::handlePublishCall(), DHT::handlePutRequest(), DHT::handlePutResponse(), PubSubLobby::handleRespCall(), Koorde::handleRpcDeBruijnRequest(), DHT::handleRpcTimeout(), PubSubMMOG::handleSubscriptionCall(), PubSubMMOG::handleTakeOver(), BaseOverlay::internalSendRpcResponse(), BaseApp::internalSendRpcResponse(), SendToKeyListener::lookupFinished(), BaseOverlay::nextHopRpc(), pingRpc(), PubSubLobby::replaceResponsibleNode(), Chord::rpcFixfingers(), Chord::rpcJoin(), Koorde::rpcNotify(), Chord::rpcNotify(), Chord::rpcStabilize(), and sendRpcResponse().

00377 {
00378     if (call == NULL || response == NULL) {
00379         throw new cRuntimeError("call or response = NULL!");
00380     }
00381 
00382     assert(transportType == INTERNAL_TRANSPORT ||
00383            !dest.isUnspecified() ||
00384            !destKey.isUnspecified());
00385 
00386     if (transportType == ROUTE_TRANSPORT)
00387         response->setSrcNode(overlay->getThisNode());
00388     else
00389         response->setSrcNode(thisNode);
00390     response->setType(RPC);
00391     response->setNonce(call->getNonce());
00392     response->setStatType(call->getStatType());
00393 
00394     RoutingType routingType = NO_OVERLAY_ROUTING;
00395     OverlayCtrlInfo* overlayCtrlInfo = NULL;
00396     if (dynamic_cast<OverlayCtrlInfo*>(call->controlInfo()))
00397         overlayCtrlInfo =
00398             static_cast<OverlayCtrlInfo*>(call->removeControlInfo());
00399     else
00400         delete call->removeControlInfo();
00401 
00402     // source routing
00403     std::vector<TransportAddress> sourceRoute;
00404     if (overlayCtrlInfo && transportType == ROUTE_TRANSPORT) {
00405         routingType =
00406             static_cast<RoutingType>(overlayCtrlInfo->getRoutingType());
00407         for (uint i = overlayCtrlInfo->getVisitedHopsArraySize(); i > 0; --i) {
00408             if (overlayCtrlInfo->getVisitedHops(i - 1) !=
00409                     overlay->getThisNode()) {
00410                 sourceRoute.push_back(overlayCtrlInfo->getVisitedHops(i - 1));
00411             }
00412         }
00413     }
00414     sourceRoute.push_back(dest);
00415 
00416     sendRpcMessageWithTransport(transportType, compType,
00417                                 routingType, sourceRoute,
00418                                 destKey, response);
00419     delete overlayCtrlInfo;
00420     delete call;
00421 }

void BaseRpc::sendRpcResponse ( BaseCallMessage *  call,
BaseResponseMessage *  response 
) [protected]

Send Remote-Procedure response message to UDP and deletes call message.

Parameters:
call The corresponding call message to the reponse
response The response message
00426 {
00427     const TransportAddress* destNode = &(call->getSrcNode());
00428     const OverlayKey* destKey = &(call->getSrcNode().key);
00429 
00430     OverlayCtrlInfo* overlayCtrlInfo =
00431         dynamic_cast<OverlayCtrlInfo*>(call->controlInfo());
00432 
00433     // "magic" transportType selection: internal
00434     if (overlayCtrlInfo &&
00435         overlayCtrlInfo->getTransportType() == INTERNAL_TRANSPORT) {
00436         sendRpcResponse(INTERNAL_TRANSPORT,
00437                         static_cast<CompType>(overlayCtrlInfo->getSrcComp()),
00438                         *destNode, *destKey, call, response);
00439     } else {
00440         internalSendRpcResponse(call, response);
00441     }
00442 }

void BaseRpc::pingNode ( const TransportAddress dest,
simtime_t  timeout = -1,
int  retries = 0,
cPolymorphic *  context = NULL,
const char *  caption = "PING",
RpcListener rpcListener = NULL,
int  rpcId = -1,
TransportType  transportType = INVALID_TRANSPORT,
bool  overrideCache = false 
) [protected]

ping a node by its TransportAddress

Statistics are collected by this method.

Parameters:
dest the node to ping
timeout RPC timeout
retries how often to retry after timeout
context a pointer to an arbitrary cPolymorphic object, which can be used to store additional state
caption special name for the ping call (instead of "PING")
rpcListener RPC Listener
rpcId RPC id
transportType The transport used for this RPC
overrideCache ignore ping cache

Referenced by BasePastry::forwardMessageRecursive(), BootstrapList::handleBootstrapListTimerExpired(), Chord::handleRpcFixfingersResponse(), Chord::handleStabilizeTimerExpired(), Pastry::handleTimerEvent(), KBRTestApp::handleTimerEvent(), Pastry::handleUDPMessage(), Kademlia::joinOverlay(), BasePastry::pingNodes(), BasePastry::prePing(), and Kademlia::routingAdd().

00594 {
00595     simtime_t rtt;
00596     if (overrideCache || neighborCache->getAddressRtt(dest) ==
00597         NEIGHBORSTATE_UNKNOWN || neighborCache->getAddressRtt(dest) ==
00598         NEIGHBORSTATE_TIMEOUT) {
00599         // if unknown or overriding, send ping call as normal
00600         PingCall* call = new PingCall(caption);
00601         call->setLength(PINGCALL_L(call));
00602         RECORD_STATS(numPingSent++; bytesPingSent += call->byteLength());
00603 
00604         if (transportType == UDP_TRANSPORT ||
00605             (transportType != ROUTE_TRANSPORT &&
00606              getThisCompType() == OVERLAY_COMP)) {
00607             sendUdpRpcCall(dest, call, context, timeout, retries, rpcId,
00608                            rpcListener);
00609         } else {
00610             sendRouteRpcCall(getThisCompType(), dest, call, context,
00611                              DEFAULT_ROUTING, timeout, retries, rpcId,
00612                              rpcListener);
00613         }
00614 
00615         //neighborCache->setAddressPinged(dest);
00616         //neighborCache->cleanupCache();
00617         neighborCache->insertPingedNode(dest, context, rpcListener, rpcId);
00618     } else if ((rtt = neighborCache->getAddressRtt(dest)) !=
00619                NEIGHBORSTATE_WAITING) {
00620         // if it's time-out or a known value, reply with fake ping response
00621         PingResponse *pr = new PingResponse();
00622         pr->setNonce(0);
00623         if (neighborCache->getNodeHandle(dest).isUnspecified())
00624             pr->setSrcNode(dest);
00625         else
00626             pr->setSrcNode(neighborCache->getNodeHandle(dest));
00627 
00628         // inform listener
00629         if (rpcListener != NULL)
00630             rpcListener->handleRpcResponse(pr, context, rpcId, rtt);
00631 
00632         pingResponse(pr, context, rpcId, rtt);
00633         handleRpcResponse(pr, context, rpcId, rtt);
00634 
00635         //delete context;
00636         delete pr;
00637     } else {
00638         assert(neighborCache->getAddressRtt(dest) == NEIGHBORSTATE_WAITING);
00639         neighborCache->insertPingedNode(dest, context, rpcListener, rpcId);
00640     }
00641 }

bool BaseRpc::handleRpc ( BaseCallMessage *  msg  )  [protected, virtual]

Processes Remote-Procedure-Call invokation messages.


This method should be overloaded when the overlay provides RPC functionality.

Returns:
true, if rpc has been handled

Reimplemented in DHT, Scribe, Broose, Chord, Kademlia, Koorde, PubSubLobby, PubSubMMOG, P2pns, and SimMud.

Referenced by internalHandleRpcMessage().

00367 {
00368     return false;
00369 }

virtual CompType BaseRpc::getThisCompType (  )  [protected, pure virtual]

Return the component type of this module.

This method is overloaded by BaseOverlay/BaseApp and returns the appropriate component type of this module.

Returns:
the component type of this module

Implemented in BaseApp, BaseOverlay, and BootstrapList.

Referenced by initRpcs(), pingNode(), sendRpcCall(), and sendRpcMessageWithTransport().

virtual void BaseRpc::sendMessageToUDP ( const TransportAddress addr,
cMessage *  message 
) [inline, protected, virtual]

Reimplemented in BaseApp, and BaseOverlay.

Referenced by sendRpcMessageWithTransport().

00421     {
00422         throw new cRuntimeError("sendMessageToUDP() not implemented");
00423     }

void BaseRpc::pingResponse ( PingResponse *  pingResponse,
cPolymorphic *  context,
int  rpcId,
simtime_t  rtt 
) [protected, virtual]

Reimplemented in KBRTestApp, BootstrapList, Chord, and BasePastry.

Referenced by Broose::handleBroosePingRequestRpc(), pingNode(), and pingRpcResponse().

00485 {
00486 }

void BaseRpc::pingTimeout ( PingCall *  pingCall,
const TransportAddress dest,
cPolymorphic *  context,
int  rpcId 
) [protected, virtual]

Reimplemented in BootstrapList, Chord, and BasePastry.

Referenced by pingRpcTimeout().

00490 {
00491 }

uint32_t BaseRpc::sendRpcCall ( TransportType  transportType,
CompType  destComp,
const TransportAddress dest,
const OverlayKey destKey,
BaseCallMessage *  msg,
cPolymorphic *  context,
RoutingType  routingType,
simtime_t  timeout,
int  retries,
int  rpcId,
RpcListener rpcListener 
) [private]

Sends a Remote-Procedure-Call message to the underlay.


USE ONE OF THE WRAPPER FUNCTIONS INSTEAD:
sendRouteRpcCall(), sendInternalRpcCall(), or sendUdpRpcCall()

If no timeout is provided, a default value of globalParameters.rpcUdpTimeout for underlay and globalParameters.rpcKeyTimeout for a overlay rpc is used. After a timeout the message gets retransmitted for at maximum retries times. The destKey attribute is kept untouched.

Parameters:
transportType The type of transport
destComp The destination component
dest Destination node handle
destKey route the RPC to the node that is responsible for destkey
msg RPC Call Message
rpcListener RPC Listener
context a pointer to an arbitrary cPolymorphic object, which can be used to store additional state
routingType KBR routing type
timeout RPC timeout
retries How often we try to resent rpc call, if it gets lost
rpcId RPC id
rpcListener RPC Listener
Returns:
The nonce of the RPC

Referenced by sendInternalRpcCall(), sendRouteRpcCall(), and sendUdpRpcCall().

00127 {
00128     // create nonce, timeout and set default parameters
00129     uint nonce;
00130     do {
00131         nonce = intuniform(1, 2147483647);
00132     } while (rpcStates.count(nonce) > 0);
00133 
00134     if (timeout == -1) {
00135         switch (transportType) {
00136         case INTERNAL_TRANSPORT:
00137             timeout = 0;
00138             break;
00139         case UDP_TRANSPORT:
00140             timeout = globalParameters->getRpcUdpTimeout();
00141             break;
00142         case ROUTE_TRANSPORT:
00143             timeout = (destKey.isUnspecified() ?
00144                        globalParameters->getRpcUdpTimeout() :
00145                        globalParameters->getRpcKeyTimeout());
00146             break;
00147         default:
00148             throw new cException("BaseRpc::sendRpcMessage(): "
00149                                  "Unknown RpcTransportType!");
00150         }
00151     }
00152 
00153     if (rpcListener == NULL)
00154         rpcListener = defaultRpcListener;
00155 
00156     // create state
00157     RpcState state;
00158     state.id = rpcId;
00159     state.timeSent = simulation.simTime();
00160     state.dest = dest.dup();
00161     state.destKey = destKey;
00162     state.srcComp = getThisCompType();
00163     state.destComp = destComp;
00164     state.listener = rpcListener;
00165     state.timeoutMsg = new RpcTimeoutMessage();
00166     state.timeoutMsg->setNonce(nonce);
00167     state.retries = retries;
00168     state.transportType = transportType;
00169     state.routingType = routingType;
00170     state.context = context;
00171 
00172     if (rpcStates.count(nonce) > 0)
00173         error("RPC nonce collision");
00174 
00175     // set message parameters
00176     msg->setNonce(nonce);
00177     if (transportType == ROUTE_TRANSPORT)
00178         msg->setSrcNode(overlay->getThisNode());
00179     else
00180         msg->setSrcNode(thisNode);
00181     msg->setType(RPC);
00182 
00183     // save copy of call message in RpcState
00184     state.callMsg = dynamic_cast<BaseCallMessage*>(msg->dup());
00185     assert(!msg->encapsulatedMsg() || !msg->encapsulatedMsg()->controlInfo());
00186 
00187     // register state
00188     rpcStates[nonce] = state;
00189 
00190     // schedule timeout message
00191     if (timeout!=0)
00192         scheduleAt( simulation.simTime() + timeout, state.timeoutMsg);
00193 
00194     //TODO
00195     std::vector<TransportAddress> sourceRoute;
00196     sourceRoute.push_back(dest);
00197     sendRpcMessageWithTransport(transportType, destComp, routingType,
00198                                 sourceRoute, destKey, msg);
00199 
00200     return nonce;
00201 }

void BaseRpc::sendRpcMessageWithTransport ( TransportType  transportType,
CompType  destComp,
RoutingType  routingType,
const std::vector< TransportAddress > &  sourceRoute,
const OverlayKey destKey,
BaseRpcMessage *  message 
) [private]

Referenced by internalHandleRpcMessage(), sendRpcCall(), and sendRpcResponse().

00450 {
00451     switch (transportType) {
00452     case UDP_TRANSPORT: {
00453         sendMessageToUDP(sourceRoute[0], message);
00454         break;
00455     }
00456     case ROUTE_TRANSPORT: {
00457         internalSendRouteRpc(message, destKey,
00458                              sourceRoute, routingType);
00459         break;
00460     }
00461     case INTERNAL_TRANSPORT: {
00462         cGate *destCompGate = overlay->getCompRpcGate(destComp);
00463         if (destCompGate == NULL) {
00464             opp_error("BaseRpc::sendRpcMessageWithTransport():"
00465                       " INTERNAL_RPC to unknown RpcCompType!");
00466         }
00467         OverlayCtrlInfo *overlayCtrlInfo = new OverlayCtrlInfo();
00468         overlayCtrlInfo->setSrcComp(getThisCompType());
00469         overlayCtrlInfo->setDestComp(destComp);
00470         overlayCtrlInfo->setTransportType(INTERNAL_TRANSPORT);
00471         message->setControlInfo(overlayCtrlInfo);
00472         sendDirect(message, 0, destCompGate);
00473         break;
00474     }
00475     default:
00476         opp_error("BaseRpc::sendRpcMessageWithTransport: "
00477                   "invalid transportType!");
00478         break;
00479     }
00480 }

virtual void BaseRpc::internalSendRouteRpc ( BaseRpcMessage *  message,
const OverlayKey destKey,
const std::vector< TransportAddress > &  sourceRoute,
RoutingType  routingType 
) [private, pure virtual]

Implemented in BaseApp, and BaseOverlay.

Referenced by sendRpcMessageWithTransport().

virtual void BaseRpc::internalSendRpcResponse ( BaseCallMessage *  call,
BaseResponseMessage *  response 
) [private, pure virtual]

Implemented in BaseApp, and BaseOverlay.

Referenced by sendRpcResponse().

void BaseRpc::pingRpc ( PingCall *  call  )  [private]

Referenced by internalHandleRpc().

00494 {
00495     std::string pongName(call->name());
00496     if (pongName == "PING")
00497         pongName = "PONG";
00498     else {
00499         pongName = "PONG: [ ";
00500         pongName += call->name();
00501         pongName += " ]";
00502     }
00503 
00504     PingResponse* response = new PingResponse(pongName.c_str());
00505     response->setLength( PINGRESPONSE_L(response) );
00506     RECORD_STATS(numPingResponseSent++; bytesPingResponseSent +=
00507         response->byteLength());
00508 
00509     sendRpcResponse(call, response );
00510 }

void BaseRpc::pingRpcResponse ( PingResponse *  response,
cPolymorphic *  context,
int  rpcId,
simtime_t  rtt 
) [private]

Referenced by internalHandleRpcResponse().

00514 {
00515     NodeHandle& srcNode = response->getSrcNode();
00516     neighborCache->insertAddressRtt(srcNode, rtt);
00517     uint numContexts = neighborCache->numInhibitedPings(srcNode);
00518     WaitingContexts* waitingContexts =
00519         neighborCache->getWaitingContexts(srcNode);
00520 
00521     pingResponse(response, context, rpcId, rtt);
00522 
00523     if (numContexts > 0) {
00524         for (uint i = 0; i < waitingContexts->pingListeners.size(); ++i) {
00525             PingResponse *pr = new PingResponse();
00526             pr->setNonce(0);
00527             if (neighborCache->getNodeHandle(srcNode).isUnspecified())
00528                 pr->setSrcNode(srcNode);
00529             else
00530                 pr->setSrcNode(neighborCache->getNodeHandle(srcNode));
00531 
00532             // inform listener
00533             if (waitingContexts->pingListeners[i] != NULL)
00534                 waitingContexts->pingListeners[i]
00535                     ->handleRpcResponse(pr, waitingContexts->pingContexts[i],
00536                                         waitingContexts->pingIds[i], rtt);
00537 
00538             handleRpcResponse(pr, waitingContexts->pingContexts[i],
00539                               waitingContexts->pingIds[i], rtt);
00540             pingResponse(pr, waitingContexts->pingContexts[i],
00541                          waitingContexts->pingIds[i], rtt);
00542 
00543             delete pr;
00544         }
00545         //neighborCache->clearNodeContexts(srcNode);
00546     }
00547     delete waitingContexts;
00548 }

void BaseRpc::pingRpcTimeout ( PingCall *  pingCall,
const TransportAddress dest,
cPolymorphic *  context,
int  rpcId 
) [private]

Referenced by internalHandleRpcTimeout().

00554 {
00555     neighborCache->addressTimeout(dest);
00556     uint numContexts = neighborCache->numInhibitedPings(dest);
00557     WaitingContexts* waitingContexts =
00558         neighborCache->getWaitingContexts(dest);
00559 
00560     pingTimeout(pingCall, dest, context, rpcId);
00561 
00562     if (numContexts > 0) {
00563         for (uint i = 0; i < waitingContexts->pingListeners.size(); ++i) {
00564             PingCall* copy = static_cast<PingCall*>(pingCall->dup());
00565             copy->setNonce(0);
00566 
00567             // inform listener
00568             if (waitingContexts->pingListeners[i] != NULL)
00569                 waitingContexts->pingListeners[i]
00570                     ->handleRpcTimeout(copy, dest,
00571                                        waitingContexts->pingContexts[i],
00572                                        waitingContexts->pingIds[i],
00573                                        OverlayKey::UNSPECIFIED_KEY);
00574 
00575             handleRpcTimeout(copy, dest, waitingContexts->pingContexts[i],
00576                              waitingContexts->pingIds[i],
00577                              OverlayKey::UNSPECIFIED_KEY);
00578             pingTimeout(copy, dest, waitingContexts->pingContexts[i],
00579                         waitingContexts->pingIds[i]);
00580 
00581             delete copy;
00582         }
00583         //neighborCache->addressTimeout(dest);
00584     }
00585     delete waitingContexts;
00586     //neighborCache->addressTimeout(dest); //TODO problem with new pings to context nodes
00587     // there must not be any contexts an rtt must be TIMEOUT before calling pingTimeout()
00588 }


Member Data Documentation

NodeHandle to this node.

Referenced by BasePastry::baseChangeState(), Broose::binaryOutput(), BaseOverlay::bindToPort(), BaseApp::bindToPort(), BaseApp::callRoute(), BaseOverlay::callUpdate(), Vast::changeState(), Pastry::changeState(), Gia::changeState(), Chord::changeState(), Broose::changeState(), Bamboo::changeState(), Pastry::checkProxCache(), Chord::closestPreceedingNode(), Broose::displayBucketState(), Pastry::doJoinUpdate(), BasePastry::doRoutingTableMaintenance(), Pastry::doSecondStage(), Koorde::findDeBruijnHop(), Koorde::findNode(), Kademlia::findNode(), Chord::findNode(), Broose::findNode(), BasePastry::findNode(), BaseOverlay::findNodeRpc(), Vast::finishOverlay(), Chord::finishOverlay(), Broose::finishOverlay(), BasePastry::finishOverlay(), BasePastry::forwardMessageRecursive(), PubSubMMOG::handleAdoptChildCall(), PubSubMMOG::handleAdoptChildResponse(), Vast::handleAppMessage(), BaseOverlay::handleBaseOverlayMessage(), BaseApp::handleCommonAPIMessage(), Koorde::handleDeBruijnTimerExpired(), Vast::handleEnclosingNeighborsRequest(), Chord::handleFixFingersTimerExpired(), PubSubMMOG::handleHelpResponse(), PubSubMMOG::handleIntermediateResponse(), Vast::handleJoin(), Vast::handleJoinAcknowledge(), Vast::handleJoinRequest(), Chord::handleJoinTimerExpired(), Broose::handleJoinTimerExpired(), BaseOverlay::handleMessage(), BaseApp::handleMessage(), Vast::handleMove(), PubSubMMOG::handleMove(), PubSubMMOG::handleMoveMessage(), Vast::handleNewNeighbors(), Chord::handleNewSuccessorHint(), Vast::handleNodeMove(), Vast::handlePing(), PubSubMMOG::handlePingCall(), SimpleGameClient::handleRealworldPacket(), Koorde::handleRpcDeBruijnRequest(), Chord::handleRpcFixfingersResponse(), Chord::handleRpcJoinResponse(), Koorde::handleRpcNotifyResponse(), Chord::handleRpcNotifyResponse(), PubSubMMOG::handleRpcResponse(), Koorde::handleRpcResponse(), Chord::handleRpcResponse(), Broose::handleRpcResponse(), Koorde::handleRpcStabilizeResponse(), Chord::handleRpcStabilizeResponse(), PubSubMMOG::handleRpcTimeout(), PubSubLobby::handleRpcTimeout(), Koorde::handleRpcTimeout(), Chord::handleRpcTimeout(), Broose::handleRpcTimeout(), Chord::handleStabilizeTimerExpired(), Pastry::handleStateMessage(), PubSubMMOG::handleSubscriptionCall(), Pastry::handleTimerEvent(), KBRTestApp::handleTimerEvent(), BaseOverlay::handleTransportAddressChangedNotification(), Vast::handleUDPMessage(), Pastry::handleUDPMessage(), BaseOverlay::initialize(), BaseApp::initialize(), KBRTestApp::initializeApp(), I3::initializeApp(), Koorde::initializeFriendModules(), Chord::initializeFriendModules(), Vast::initializeOverlay(), PubSubMMOG::initializeOverlay(), PubSubLobby::initializeOverlay(), Chord::initializeOverlay(), I3::insertTrigger(), internalHandleRpcMessage(), BaseOverlay::internalHandleRpcTimeout(), Kademlia::isSiblingFor(), Chord::isSiblingFor(), Broose::isSiblingFor(), BasePastry::isSiblingFor(), BaseOverlay::join(), Chord::joinForeignPartition(), Kademlia::joinOverlay(), SendToKeyListener::lookupFinished(), BaseOverlay::neighborSet(), BasePastry::pingNodes(), Chord::pingResponse(), BasePastry::pingResponse(), Chord::pingTimeout(), BasePastry::pingTimeout(), BasePastry::prePing(), Vast::processPingTimer(), Vast::receiveChangeNotification(), BaseOverlay::route(), Kademlia::routingInit(), Chord::rpcFixfingers(), Chord::rpcJoin(), Koorde::rpcNotify(), Chord::rpcNotify(), Vast::sendDiscardNode(), BasePastry::sendLeafset(), Vast::sendMessage(), BaseOverlay::sendMessageToUDP(), BaseApp::sendMessageToUDP(), I3::sendPacket(), I3::sendQueryReply(), BasePastry::sendRequest(), BaseOverlay::sendRouteMessage(), BasePastry::sendRoutingRow(), sendRpcCall(), sendRpcResponse(), BasePastry::sendStateTables(), Vast::sendToApp(), BaseOverlay::sendToKey(), BaseOverlay::setOverlayReady(), BasePastry::setOwnNodeID(), BaseOverlay::setOwnNodeID(), PubSubMMOG::startTimer(), PubSubMMOG::takeOverSubspace(), SimpleGameClient::updateNeighbors(), Koorde::updateTooltip(), Kademlia::updateTooltip(), Gia::updateTooltip(), Chord::updateTooltip(), Broose::updateTooltip(), and BasePastry::updateTooltip().

Referenced by Scribe::addChildToGroup(), BaseApp::BaseApp(), BaseApp::callLocalLookup(), BaseApp::callNeighborSet(), BaseApp::callRoute(), Scribe::checkGroupEmpty(), RealWorldTestApp::deliver(), KBRTestApp::deliver(), Scribe::deliverALMDataToGroup(), XmlRpcInterface::dumpDht(), Scribe::forward(), KBRTestApp::forward(), BaseApp::forwardResponse(), XmlRpcInterface::get(), BootstrapList::getBootstrapNode(), BaseApp::handleCommonAPIMessage(), Scribe::handleJoinMessage(), Scribe::handleJoinResponse(), KBRTestApp::handleLookupResponse(), DHT::handleLookupResponse(), BootstrapList::handleLookupResponse(), GIASearchApp::handleLowerMessage(), XmlRpcInterface::handleMessage(), BaseApp::handleMessage(), SimMud::handleMove(), SimMud::handleOtherPlayerMove(), Scribe::handlePublishCall(), Scribe::handlePublishResponse(), DHT::handlePutRequest(), Scribe::handleRpcResponse(), KBRTestApp::handleRpcResponse(), BootstrapList::handleRpcResponse(), SimpleGameClient::handleTimerEvent(), Scribe::handleTimerEvent(), KBRTestApp::handleTimerEvent(), GIASearchApp::handleTimerEvent(), DHT::handleTimerEvent(), Scribe::handleUpperMessage(), DHT::initializeApp(), initRpcs(), BaseApp::isSiblingFor(), XmlRpcInterface::joinOverlay(), XmlRpcInterface::localLookup(), BootstrapList::locateBootstrapNode(), XmlRpcInterface::lookup(), IterativeLookup::lookup(), SendToKeyListener::lookupFinished(), BambooLookupListener::lookupFinished(), XmlRpcInterface::p2pnsRegister(), P2pns::p2pnsRegisterRpc(), XmlRpcInterface::p2pnsResolve(), BootstrapList::pingResponse(), BootstrapList::pingTimeout(), XmlRpcInterface::put(), BootstrapList::removeBootstrapNode(), BaseApp::sendMessageToUDP(), sendRpcCall(), sendRpcMessageWithTransport(), sendRpcResponse(), Scribe::subscribeToGroup(), Scribe::update(), DHT::update(), and SendToKeyListener::~SendToKeyListener().

bool BaseRpc::debugOutput [protected]

debug output ?

Reimplemented in BaseApp, BaseOverlay, and DHTTestApp.

CompType BaseRpc::thisCompType [protected]

Referenced by BaseApp::callRoute(), and initRpcs().

int BaseRpc::numPingSent [protected]

int BaseRpc::bytesPingSent [protected]

int BaseRpc::rpcsPending [private]

Referenced by initRpcs().

double BaseRpc::rpcUdpTimeout [private]

double BaseRpc::rpcKeyTimeout [private]


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

Generated on Fri Sep 19 13:05:06 2008 for ITM OverSim by  doxygen 1.5.5