ClientCommon Class Reference

#include <client_common.h>

Inheritance diagram for ClientCommon:

Inheritance graph
[legend]
Collaboration diagram for ClientCommon:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 ClientCommon (int _fd=-1)
virtual ~ClientCommon ()
virtual void Disconnect ()
virtual bool Receive (unsigned int len=4096)
std::string ReceiveToEOL ()
PacketReceivePacket ()
int BytesReceived ()
virtual bool IsConnected ()=0
virtual const std::string GetAddress ()=0
const std::string GetIp ()
int GetPort ()
virtual void OnDisconnect ()

Protected Member Functions

bool Send (const char *buf, unsigned int len)
bool Send (const std::string &str)
bool Send (Packet *p)
virtual void Reconnect ()

Protected Attributes

int fd
char * buffer
unsigned int buffer_len
std::string client_host
int client_port
bool reconnect


Detailed Description

Definition at line 7 of file client_common.h.


Constructor & Destructor Documentation

ClientCommon::ClientCommon ( int  _fd = -1  ) 

Definition at line 20 of file client_common.cpp.

ClientCommon::~ClientCommon (  )  [virtual]

Definition at line 24 of file client_common.cpp.


Member Function Documentation

int ClientCommon::BytesReceived (  ) 

Definition at line 234 of file client_common.cpp.

void ClientCommon::Disconnect (  )  [virtual]

Reimplemented in ServerClient.

Definition at line 30 of file client_common.cpp.

virtual const std::string ClientCommon::GetAddress (  )  [pure virtual]

Implemented in Client, and ServerClient.

const std::string ClientCommon::GetIp (  ) 

Definition at line 273 of file client_common.cpp.

int ClientCommon::GetPort (  ) 

Definition at line 282 of file client_common.cpp.

virtual bool ClientCommon::IsConnected (  )  [pure virtual]

Implemented in Client, and ServerClient.

virtual void ClientCommon::OnDisconnect (  )  [inline, virtual]

Reimplemented in Client.

Definition at line 38 of file client_common.h.

bool ClientCommon::Receive ( unsigned int  len = 4096  )  [virtual]

Definition at line 101 of file client_common.cpp.

Packet * ClientCommon::ReceivePacket (  ) 

Definition at line 192 of file client_common.cpp.

std::string ClientCommon::ReceiveToEOL (  ) 

Definition at line 140 of file client_common.cpp.

virtual void ClientCommon::Reconnect (  )  [inline, protected, virtual]

Reimplemented in Client.

Definition at line 23 of file client_common.h.

bool ClientCommon::Send ( Packet p  )  [protected]

Definition at line 77 of file client_common.cpp.

bool ClientCommon::Send ( const std::string &  str  )  [protected]

Definition at line 91 of file client_common.cpp.

bool ClientCommon::Send ( const char *  buf,
unsigned int  len 
) [protected]

Definition at line 46 of file client_common.cpp.


Member Data Documentation

char* ClientCommon::buffer [protected]

Definition at line 12 of file client_common.h.

unsigned int ClientCommon::buffer_len [protected]

Definition at line 13 of file client_common.h.

std::string ClientCommon::client_host [protected]

Definition at line 15 of file client_common.h.

int ClientCommon::client_port [protected]

Definition at line 16 of file client_common.h.

int ClientCommon::fd [protected]

Definition at line 10 of file client_common.h.

bool ClientCommon::reconnect [protected]

Definition at line 19 of file client_common.h.


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

Generated on Sun Oct 10 19:10:04 2010 for libldsw by  doxygen 1.5.8