1 |
ab11 |
1.1 |
#include <iostream> |
2 |
|
|
#include <string> |
3 |
|
|
#include "socket++-1.10/sockinet.h" |
4 |
|
|
|
5 |
|
|
using std::string; |
6 |
|
|
|
7 |
|
|
class SubNet { |
8 |
|
|
|
9 |
|
|
public: |
10 |
|
|
// constructor |
11 |
|
|
SubNet(string host, int port); |
12 |
ab11 |
1.2 |
SubNet(); // no arg constructor |
13 |
|
|
~SubNet(); // destructor |
14 |
|
|
string sendTCP(string text); |
15 |
|
|
void sendUPDPacket( string host, int port, string message ); |
16 |
|
|
int isConnected(); |
17 |
ab11 |
1.1 |
|
18 |
|
|
private: |
19 |
|
|
int connect; |
20 |
|
|
iosockinet * socket; // TCP socket |
21 |
ab11 |
1.2 |
osockinet * udp; // UDP socket |
22 |
ab11 |
1.1 |
}; // class |