#include <client_common.h>


Public Member Functions | |
| ClientCommon (int _fd=-1) | |
| virtual | ~ClientCommon () |
| virtual void | Disconnect () |
| virtual bool | Receive (unsigned int len=4096) |
| std::string | ReceiveToEOL () |
| Packet * | ReceivePacket () |
| 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 |
Definition at line 7 of file client_common.h.
| 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.
| int ClientCommon::BytesReceived | ( | ) |
Definition at line 234 of file client_common.cpp.
| void ClientCommon::Disconnect | ( | ) | [virtual] |
| 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] |
| 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] |
| 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.
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.
1.5.8