1 |
ab11 |
1.1 |
#include <iostream> |
2 |
|
|
#include <string> |
3 |
ab11 |
1.3 |
#include "socket++-1.10/sockinet.h" |
4 |
ab11 |
1.1 |
|
5 |
|
|
using std::string; |
6 |
|
|
|
7 |
|
|
class SmallNet { |
8 |
|
|
|
9 |
|
|
public: |
10 |
|
|
// constructor |
11 |
ab11 |
1.3 |
SmallNet(int printDebug); |
12 |
ab11 |
1.1 |
// heartbeat section |
13 |
|
|
int connectHeartBeat(string host, int port); |
14 |
|
|
string heartBeatSend(string text); |
15 |
|
|
void closeHeartBeatConnection(); |
16 |
|
|
// config section |
17 |
ab11 |
1.3 |
int connectConfig(string host,int port); |
18 |
ab11 |
1.1 |
string configSend(string text); |
19 |
|
|
void closeConfigConnection(); |
20 |
|
|
// misc stuff |
21 |
ab11 |
1.3 |
void sendUPDPacket( string host, int port, string message ); |
22 |
ab11 |
1.1 |
string getIPfromHost(string hostname); |
23 |
|
|
private: |
24 |
ab11 |
1.3 |
|
25 |
|
|
int debug; // print debug info? |
26 |
|
|
iosockinet * socket; // TCP socket |
27 |
|
|
|
28 |
|
|
|
29 |
|
|
|
30 |
|
|
|
31 |
ab11 |
1.1 |
}; // class |