1 #ifndef SOCKET_ADDRESS_H
2 #define SOCKET_ADDRESS_H
5 #include "numeric_types.h"
6 #include "socket_portable.h"
17 typedef struct sockaddr_in AddressType;
19 AddressType &GetAddressInfo() {
return _addr; }
20 const AddressType &GetAddressInfo()
const {
return _addr; }
23 INLINE Socket_Address(
unsigned short port = 0);
24 INLINE Socket_Address(
const Socket_Address &inaddr);
26 INLINE
virtual ~Socket_Address();
28 INLINE
bool set_any_IP(
int port);
29 INLINE
bool set_port(
int port);
30 INLINE
bool set_broadcast(
int port);
32 INLINE
bool set_host(
const std::string &hostname,
int port) ;
33 INLINE
bool set_host(
const std::string &hostname) ;
34 INLINE
bool set_host(
unsigned int ip4adr,
int port);
37 INLINE
unsigned short get_port()
const;
38 INLINE std::string get_ip()
const ;
39 INLINE std::string get_ip_port()
const;
40 INLINE
unsigned long GetIPAddressRaw()
const;
42 INLINE
bool operator ==(
const Socket_Address &in)
const;
43 INLINE
bool operator !=(
const Socket_Address &in)
const;
44 INLINE
bool operator < (
const Socket_Address &in)
const;
46 INLINE
bool is_mcast_range()
const;
52 #include "socket_address.I"
54 #endif // SOCKET_ADDRESS_H
A simple place to store and munipulate tcp and port address for communication layer.