30 lines
677 B
C++
30 lines
677 B
C++
#ifndef __IPAddress_h__
|
|
#define __IPAddress_h__
|
|
|
|
#include "includes"
|
|
#include "Object.h"
|
|
|
|
namespace core {
|
|
|
|
class IPAddress : public Object {
|
|
|
|
public:
|
|
IPAddress();
|
|
IPAddress(std::string address);
|
|
IPAddress(std::string address, short int port);
|
|
~IPAddress();
|
|
|
|
struct sockaddr_in address;
|
|
socklen_t addressLength;
|
|
struct sockaddr *pointer;
|
|
|
|
std::string getClientAddress(); ///<Get the client network address as xxx.xxx.xxx.xxx.
|
|
std::string getClientAddressAndPort(); ///<Get the client network address and port as xxx.xxx.xxx.xxx:ppppp.
|
|
int getClientPort(); ///<Get the client network port number.
|
|
|
|
};
|
|
|
|
}
|
|
|
|
#endif
|