14 #ifndef SOCKET_ADDRESS_H 15 #define SOCKET_ADDRESS_H 19 #include "socket_portable.h" 31 INLINE
struct sockaddr &GetAddressInfo() {
return _addr; }
32 INLINE
const struct sockaddr &GetAddressInfo()
const {
return _addr; }
40 INLINE
bool set_any_IP(
unsigned short port);
41 INLINE
bool set_any_IPv6(
unsigned short port);
42 INLINE
bool set_port(
unsigned short port);
43 INLINE
bool set_broadcast(
unsigned short port);
45 bool set_host(
const std::string &hostname,
unsigned short port);
46 bool set_host(
const std::string &hostname);
47 INLINE
bool set_host(uint32_t ip4addr,
unsigned short port);
50 INLINE sa_family_t get_family()
const;
51 INLINE
unsigned short get_port()
const;
52 std::string get_ip()
const ;
53 std::string get_ip_port()
const;
54 unsigned long GetIPAddressRaw()
const;
60 INLINE
bool is_any()
const;
61 INLINE
bool is_mcast_range()
const;
68 sockaddr_storage _storage;
74 #endif // SOCKET_ADDRESS_H PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
A simple place to store and manipulate tcp and port address for communication layer.