![]() |
SocketAddress Class ReferenceThis class and its subclasses is intended to be used as replacement for the internal data type 'ipaddr_t' and various implementations of IPv6 addressing found throughout the library.
More...
|
Public Member Functions | |
virtual | ~SocketAddress () |
virtual | operator struct sockaddr * ()=0 |
Get a pointer to the address struct. | |
virtual | operator socklen_t ()=0 |
Get length of address struct. | |
virtual bool | operator== (SocketAddress &)=0 |
Compare two addresses. | |
virtual void | SetPort (port_t port)=0 |
Set port number. | |
virtual port_t | GetPort ()=0 |
Get port number. | |
virtual void | SetAddress (struct sockaddr *sa)=0 |
Set socket address. | |
virtual std::string | Convert (bool include_port)=0 |
Convert address to text. | |
virtual std::string | Reverse ()=0 |
Reverse lookup of address. | |
virtual int | GetFamily ()=0 |
Get address family. | |
virtual bool | IsValid ()=0 |
Address structure is valid. | |
virtual std::auto_ptr < SocketAddress > | GetCopy ()=0 |
Get a copy of this SocketAddress object. |
'ipaddr_t' is an IPv4 address in network byte order. 'port_t' is the portnumber in host byte order. 'struct in6_addr' is an IPv6 address. 'struct in_addr' is an IPv4 address.
Definition at line 56 of file SocketAddress.h.
virtual SocketAddress::~SocketAddress | ( | ) | [inline, virtual] |
virtual SocketAddress::operator struct sockaddr * | ( | ) | [pure virtual] |
virtual SocketAddress::operator socklen_t | ( | ) | [pure virtual] |
virtual bool SocketAddress::operator== | ( | SocketAddress & | ) | [pure virtual] |
virtual void SocketAddress::SetPort | ( | port_t | port | ) | [pure virtual] |
Set port number.
port | Port number in host byte order |
Implemented in Ipv4Address.
Referenced by UdpSocket::Bind().
virtual port_t SocketAddress::GetPort | ( | ) | [pure virtual] |
Get port number.
Implemented in Ipv4Address.
Referenced by UdpSocket::Bind(), SctpSocket::Bind(), ListenSocket< X >::Bind(), and TcpSocket::Open().
virtual void SocketAddress::SetAddress | ( | struct sockaddr * | sa | ) | [pure virtual] |
Set socket address.
sa | Pointer to either 'struct sockaddr_in' or 'struct sockaddr_in6'. |
Implemented in Ipv4Address.
virtual std::string SocketAddress::Convert | ( | bool | include_port | ) | [pure virtual] |
virtual std::string SocketAddress::Reverse | ( | ) | [pure virtual] |
virtual int SocketAddress::GetFamily | ( | ) | [pure virtual] |
Get address family.
Implemented in Ipv4Address.
Referenced by UdpSocket::Bind(), SctpSocket::Bind(), ListenSocket< X >::Bind(), UdpSocket::Open(), TcpSocket::Open(), SctpSocket::Open(), Ipv4Address::operator==(), and UdpSocket::SendToBuf().
virtual bool SocketAddress::IsValid | ( | ) | [pure virtual] |
Address structure is valid.
Implemented in Ipv4Address.
Referenced by SctpSocket::AddAddress(), SctpSocket::AddConnection(), SctpSocket::Bind(), TcpSocket::Open(), SctpSocket::Open(), SctpSocket::RemoveAddress(), and Socket::SetClientRemoteAddress().
virtual std::auto_ptr<SocketAddress> SocketAddress::GetCopy | ( | ) | [pure virtual] |
Get a copy of this SocketAddress object.
Implemented in Ipv4Address.
Referenced by Socket::SetClientRemoteAddress(), and Socket::SetRemoteAddress().