RpcListener Class Reference

A Remote-Procedure-Call listener class. More...

#include <RpcListener.h>

Inheritance diagram for RpcListener:
BaseRpc IterativeLookup Nps RecursiveLookup BaseApp BaseOverlay ALMTest BootstrapList CBRDHT DHT DHTTestApp GIASearchApp I3 KBRTestApp Landmark MyApplication NeighborCache P2pns P2PNSTestApp RealWorldTestApp Scribe SimMud SimpleGameClient TierDummy XmlRpcInterface BasePastry Broose Gia Kademlia MyOverlay OverlayDummy oversim::Chord oversim::Nice PubSubLobby PubSubMMOG Quon Vast

List of all members.

Public Member Functions

virtual ~RpcListener ()
 destructor

Protected Member Functions

virtual void handleRpcResponse (BaseResponseMessage *msg, cPolymorphic *context, int rpcId, simtime_t rtt)
 This method is called if an RPC response has been received.
virtual void handleRpcResponse (BaseResponseMessage *msg, const RpcState &rpcState, simtime_t rtt)
 This method is called if an RPC response has been received.
virtual void handleRpcTimeout (BaseCallMessage *msg, const TransportAddress &dest, cPolymorphic *context, int rpcId, const OverlayKey &destKey)
 This method is called if an RPC timeout has been reached.
virtual void handleRpcTimeout (const RpcState &rpcState)
 This method is called if an RPC timeout has been reached.

Friends

class BaseRpc

Detailed Description

A Remote-Procedure-Call listener class.

Author:
Sebastian Mies

Definition at line 40 of file RpcListener.h.


Constructor & Destructor Documentation

RpcListener::~RpcListener (  )  [virtual]

destructor

Definition at line 28 of file RpcListener.cc.

00029 {}


Member Function Documentation

void RpcListener::handleRpcResponse ( BaseResponseMessage *  msg,
const RpcState rpcState,
simtime_t  rtt 
) [protected, virtual]

This method is called if an RPC response has been received.

Parameters:
msg The response message.
rpcState Reference to an RpcState object containing e.g. the original call message, the destination (TransportAddress and/or OverlayKey), a context pointer, ...
rtt The round-trip time of this RPC

Reimplemented in Broose, and DHTTestApp.

Definition at line 39 of file RpcListener.cc.

00041 {
00042     handleRpcResponse(msg, state.getContext(), state.getId(), rtt);
00043 }

void RpcListener::handleRpcResponse ( BaseResponseMessage *  msg,
cPolymorphic *  context,
int  rpcId,
simtime_t  rtt 
) [protected, virtual]

This method is called if an RPC response has been received.

Parameters:
msg The response message.
context Pointer to an optional state object. The object has to be handled/deleted by the handleRpcResponse() code
rpcId The RPC id.
rtt The Round-Trip-Time of this RPC

Reimplemented in DHT, KBRTestApp, Scribe, BootstrapList, CBRDHT, IterativeLookup, Nps, RecursiveLookup, oversim::Chord, Kademlia, oversim::Koorde, MyOverlay, PubSubLobby, PubSubMMOG, P2pns, SimMud, P2PNSTestApp, and XmlRpcInterface.

Definition at line 31 of file RpcListener.cc.

Referenced by handleRpcResponse(), and BaseRpc::internalHandleRpcMessage().

00034 {
00035     //std::cout << "Default RpcListener Response: from="
00036     //          << msg->getSrcNode().ip << " msg=" << *msg << std::endl;
00037 }

void RpcListener::handleRpcTimeout ( const RpcState rpcState  )  [protected, virtual]

This method is called if an RPC timeout has been reached.

Parameters:
rpcState Reference to an RpcState object containing e.g. the original call message, the destination (TransportAddress and/or OverlayKey), a context pointer, ...

Reimplemented in Broose.

Definition at line 54 of file RpcListener.cc.

00054                                                         {
00055     handleRpcTimeout(const_cast<BaseCallMessage*>(state.getCallMsg()),
00056                      state.getDest(), state.getContext(),
00057                      state.getId(), state.getDestKey());
00058 }

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

This method is called if an RPC timeout has been reached.

Parameters:
msg The original RPC message.
dest The destination node
context Pointer to an optional state object. The object has to be handled/deleted by the handleRpcResponse() code
rpcId The RPC id.
destKey the destination OverlayKey

Reimplemented in DHT, KBRTestApp, CBRDHT, IterativeLookup, Nps, RecursiveLookup, oversim::Chord, Kademlia, oversim::Koorde, MyOverlay, PubSubLobby, PubSubMMOG, and XmlRpcInterface.

Definition at line 45 of file RpcListener.cc.

Referenced by handleRpcTimeout(), and BaseRpc::internalHandleRpcMessage().

00049 {
00050     //std::cout << "Default RpcListener Timeout: " << msg->getName()
00051     //          << std::endl;
00052 }


Friends And Related Function Documentation

friend class BaseRpc [friend]

Definition at line 42 of file RpcListener.h.


The documentation for this class was generated from the following files:
Generated on Wed May 26 16:21:19 2010 for OverSim by  doxygen 1.6.3