My Project
IPAddress.h
1 #ifndef __IPAddress_h__
2 #define __IPAddress_h__
3 
4 #include "includes"
5 #include "Object.h"
6 
7 namespace core {
8 
9  class IPAddress : public Object {
10 
11  public:
12  IPAddress();
13  IPAddress(std::string address);
14  IPAddress(std::string address, int port);
15  ~IPAddress();
16 
17  struct sockaddr_in addr;
18  socklen_t addressLength;
19 
20  struct sockaddr * getPointer();
21  std::string getClientAddress();
22  std::string getClientAddressAndPort();
23  int getClientPort();
24 
25  };
26 
27 }
28 
29 #endif
Definition: IPAddress.h:9
int getClientPort()
Get the client network port number.
Definition: IPAddress.cpp:47
std::string getClientAddressAndPort()
Get the client network address and port as xxx.xxx.xxx.xxx:ppppp.
Definition: IPAddress.cpp:40
std::string getClientAddress()
Get the client network address as xxx.xxx.xxx.xxx.
Definition: IPAddress.cpp:35
Definition: Object.h:8