Data Structures | Public Types | Public Member Functions | Data Fields | Protected Attributes

Peer Class Reference

#include <ICP.h>

Inherits RefCountObj.

Inherited by MultiCastPeer, and ParentSiblingPeer.

Collaboration diagram for Peer:
Collaboration graph
[legend]

Data Structures

struct  PeerStats

Public Types

enum  { OFFLINE_THRESHOLD = 20 }

Public Member Functions

 Peer (PeerType_t, ICPProcessor *, bool dynamic_peer=false)
virtual ~Peer ()
void LogRecvMsg (ICPMsg_t *, int)
virtual sockaddr * GetIP ()=0
virtual ActionSendMsg_re (Continuation *, void *, struct msghdr *, struct sockaddr const *to)=0
virtual ActionRecvFrom_re (Continuation *, void *, IOBufferBlock *, int, struct sockaddr *, socklen_t *)=0
virtual int GetRecvFD ()=0
virtual int GetSendFD ()=0
virtual int ExpectedReplies (BitMap *)=0
virtual int ValidSender (sockaddr *)=0
virtual void LogSendMsg (ICPMsg_t *, sockaddr const *)=0
virtual int IsOnline ()=0
virtual ConnectionGetSendChan ()=0
virtual ConnectionGetRecvChan ()=0
virtual int ExtToIntRecvSockAddr (sockaddr const *, sockaddr *)=0
PeerType_t GetType ()
int GetPeerID ()
void SetPeerID (int newid)
void SetNext (Peer *p)
PeerGetNext ()
bool shouldStartRead ()
void startingRead ()
void cancelRead ()
bool readActive ()
bool isUp ()

Data Fields

Ptr< IOBufferBlockbuf
IpEndpoint fromaddr
socklen_t fromaddrlen
int notFirstRead
ActionreadAction
ActionwriteAction

Protected Attributes

PeerType_t _type
int _id
Peer_next
ICPProcessor_ICPpr
int _state
struct Peer::PeerStats _stats

Detailed Description

Definition at line 501 of file ICP.h.


Member Enumeration Documentation

anonymous enum
Enumerator:
OFFLINE_THRESHOLD 

Definition at line 524 of file ICP.h.


Constructor & Destructor Documentation

Peer::Peer ( PeerType_t  t,
ICPProcessor icpPr,
bool  dynamic_peer = false 
)

Definition at line 784 of file ICPConfig.cc.

References _id, _state, _stats, fromaddr, fromaddrlen, and notFirstRead.

virtual Peer::~Peer (  )  [inline, virtual]

Definition at line 505 of file ICP.h.


Member Function Documentation

void Peer::cancelRead (  )  [inline]

Definition at line 555 of file ICP.h.

References notFirstRead.

virtual int Peer::ExpectedReplies ( BitMap  )  [pure virtual]

Implemented in ParentSiblingPeer, and MultiCastPeer.

virtual int Peer::ExtToIntRecvSockAddr ( sockaddr const *  ,
sockaddr *   
) [pure virtual]

Implemented in ParentSiblingPeer, and MultiCastPeer.

virtual sockaddr* Peer::GetIP (  )  [pure virtual]
Peer* Peer::GetNext (  )  [inline]
int Peer::GetPeerID (  )  [inline]

Definition at line 531 of file ICP.h.

References _id.

Referenced by ParentSiblingPeer::ExpectedReplies().

virtual Connection* Peer::GetRecvChan (  )  [pure virtual]

Implemented in ParentSiblingPeer, and MultiCastPeer.

virtual int Peer::GetRecvFD (  )  [pure virtual]
virtual Connection* Peer::GetSendChan (  )  [pure virtual]

Implemented in ParentSiblingPeer, and MultiCastPeer.

virtual int Peer::GetSendFD (  )  [pure virtual]

Implemented in ParentSiblingPeer, and MultiCastPeer.

PeerType_t Peer::GetType (  )  [inline]

Definition at line 527 of file ICP.h.

References _type.

Referenced by ParentSiblingPeer::ExtToIntRecvSockAddr().

virtual int Peer::IsOnline (  )  [pure virtual]
bool Peer::isUp (  )  [inline]

Definition at line 563 of file ICP.h.

References _state, and PEER_UP.

void Peer::LogRecvMsg ( ICPMsg_t m,
int  valid 
)
virtual void Peer::LogSendMsg ( ICPMsg_t ,
sockaddr const *   
) [pure virtual]

Implemented in ParentSiblingPeer, and MultiCastPeer.

Referenced by MultiCastPeer::LogSendMsg().

bool Peer::readActive (  )  [inline]

Definition at line 559 of file ICP.h.

References readAction.

virtual Action* Peer::RecvFrom_re ( Continuation ,
void *  ,
IOBufferBlock ,
int  ,
struct sockaddr *  ,
socklen_t *   
) [pure virtual]

Implemented in ParentSiblingPeer, and MultiCastPeer.

virtual Action* Peer::SendMsg_re ( Continuation ,
void *  ,
struct msghdr *  ,
struct sockaddr const *  to 
) [pure virtual]

Implemented in ParentSiblingPeer, and MultiCastPeer.

void Peer::SetNext ( Peer p  )  [inline]

Definition at line 539 of file ICP.h.

References _next.

Referenced by MultiCastPeer::AddMultiCastChild().

void Peer::SetPeerID ( int  newid  )  [inline]

Definition at line 535 of file ICP.h.

References _id.

bool Peer::shouldStartRead (  )  [inline]

Definition at line 547 of file ICP.h.

References notFirstRead.

Referenced by ICPHandlerCont::PeriodicEvent().

void Peer::startingRead (  )  [inline]

Definition at line 551 of file ICP.h.

References notFirstRead.

Referenced by ICPHandlerCont::PeriodicEvent().

virtual int Peer::ValidSender ( sockaddr *   )  [pure virtual]

Implemented in ParentSiblingPeer, and MultiCastPeer.


Field Documentation

ICPProcessor* Peer::_ICPpr [protected]
int Peer::_id [protected]

Definition at line 579 of file ICP.h.

Referenced by GetPeerID(), Peer(), and SetPeerID().

Peer* Peer::_next [protected]
int Peer::_state [protected]
struct Peer::PeerStats Peer::_stats [protected]
PeerType_t Peer::_type [protected]

Definition at line 578 of file ICP.h.

Referenced by GetType(), and ParentSiblingPeer::ValidSender().

Definition at line 570 of file ICP.h.

Referenced by MultiCastPeer::RecvFrom_re().

Definition at line 571 of file ICP.h.

Referenced by Peer().

socklen_t Peer::fromaddrlen

Definition at line 572 of file ICP.h.

Referenced by Peer().

Definition at line 573 of file ICP.h.

Referenced by cancelRead(), Peer(), shouldStartRead(), and startingRead().

Definition at line 574 of file ICP.h.

Referenced by readActive().

Definition at line 575 of file ICP.h.


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