| 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 |
SubNet(); |
| 13 |
string sendTCP(string text); |
| 14 |
void sendUPDPacket( string host, int port, string message ); |
| 15 |
string getIPfromHost(string hostname); |
| 16 |
string getHostName(); |
| 17 |
string getHostIP(); |
| 18 |
int isConnected(); |
| 19 |
|
| 20 |
private: |
| 21 |
int connect; |
| 22 |
iosockinet * socket; // TCP socket |
| 23 |
osockinet * udp; // UDP socket |
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
}; // class |