OverSim
RpcListener Class Reference

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

#include <RpcListener.h>

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

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.

{}

Member Function Documentation

void RpcListener::handleRpcResponse ( BaseResponseMessage msg,
cPolymorphic *  context,
int  rpcId,
simtime_t  rtt 
)
protectedvirtual

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

Parameters
msgThe response message.
contextPointer to an optional state object. The object has to be handled/deleted by the handleRpcResponse() code
rpcIdThe RPC id.
rttThe Round-Trip-Time of this RPC

Reimplemented in IterativeLookup, oversim::Chord, TreeManagement, BasePastry, Nps, XmlRpcInterface, Kademlia, oversim::Koorde, GlobalViewBuilder, RecursiveLookup, Scribe, Pastry, CBRDHT, SimMud, Bamboo, NTree, PubSubLobby, and PubSubMMOG.

Definition at line 31 of file RpcListener.cc.

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

{
//std::cout << "Default RpcListener Response: from="
// << msg->getSrcNode().getIp() << " msg=" << *msg << std::endl;
}
void RpcListener::handleRpcResponse ( BaseResponseMessage msg,
const RpcState rpcState,
simtime_t  rtt 
)
protectedvirtual

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

Parameters
msgThe response message.
rpcStateReference to an RpcState object containing e.g. the original call message, the destination (TransportAddress and/or OverlayKey), a context pointer, ...
rttThe round-trip time of this RPC

Reimplemented in Broose.

Definition at line 39 of file RpcListener.cc.

{
handleRpcResponse(msg, state.getContext(), state.getId(), rtt);
}
void RpcListener::handleRpcTimeout ( BaseCallMessage msg,
const TransportAddress dest,
cPolymorphic *  context,
int  rpcId,
const OverlayKey destKey 
)
protectedvirtual

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

Parameters
msgThe original RPC message.
destThe destination node
contextPointer to an optional state object. The object has to be handled/deleted by the handleRpcResponse() code
rpcIdThe RPC id.
destKeythe destination OverlayKey

Reimplemented in oversim::Chord, IterativeLookup, BasePastry, XmlRpcInterface, Nps, Kademlia, oversim::Koorde, GlobalViewBuilder, Pastry, TreeManagement, RecursiveLookup, CBRDHT, NTree, PubSubLobby, and PubSubMMOG.

Definition at line 45 of file RpcListener.cc.

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

{
//std::cout << "Default RpcListener Timeout: " << msg->getName()
// << std::endl;
}
void RpcListener::handleRpcTimeout ( const RpcState rpcState)
protectedvirtual

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

Parameters
rpcStateReference 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.

{
handleRpcTimeout(const_cast<BaseCallMessage*>(state.getCallMsg()),
state.getDest(), state.getContext(),
state.getId(), state.getDestKey());
}

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: