-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCConnection.h
36 lines (29 loc) · 893 Bytes
/
CConnection.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#ifndef CCONNECTION_H
#define CCONNECTION_H
class CConnection
{
protected:
string strHost, strUsername, strIdent, strServer, strMOTD;
int iPort;
unsigned int sock;
struct sockaddr_in addrLocal;
string strPacketBuffer;
public:
CConnection(string host, int port);
~CConnection();
bool SendData (string data);
int ReadData(char* buf);
void HandleData(string data);
bool DataArrived (void);
bool Connect(string nick, string realname);
bool Connected(void);
string GetHost(void) { return strHost; };
string GetUsername(void) { return strUsername; };
string GetIdent(void) { return strIdent; };
string GetServer(void) { return strServer; };
int GetPort(void) { return iPort; };
std::vector<std::string> Split(const std::string &s, char delim);
void AddClient(string nick);
int GetNewClientID(void);
};
#endif