PTLib
Version 2.14.3
|
A class describing an IP address and port number combination. More...
#include <ipsock.h>
Public Member Functions | |
AddressAndPort (char separator= ':') | |
AddressAndPort (WORD defaultPort, char separator= ':') | |
AddressAndPort (const PString &str, WORD defaultPort=0, char separator= ':', const char *proto=NULL) | |
AddressAndPort (const PIPSocket::Address &addr, WORD defaultPort=0, char separator= ':') | |
AddressAndPort (struct sockaddr *ai_addr, const int ai_addrlen) | |
bool | Parse (const PString &str, WORD defaultPort=0, char separator= ':', const char *proto=NULL) |
PString | AsString (char separator=0) const |
const PIPSocket::Address & | GetAddress () const |
void | SetAddress (const PIPSocket::Address &addr, WORD port=0) |
WORD | GetPort () const |
void | SetPort (WORD port) |
bool | IsValid () const |
bool | operator== (const AddressAndPort &obj) const |
bool | operator!= (const AddressAndPort &obj) const |
bool | MatchWildcard (const AddressAndPort &wild) const |
Protected Attributes | |
PIPSocket::Address | m_address |
WORD | m_port |
char | m_separator |
Friends | |
ostream & | operator<< (ostream &strm, const AddressAndPort &ap) |
A class describing an IP address and port number combination.
PIPSocket::AddressAndPort::AddressAndPort | ( | char | separator = ':' | ) |
PIPSocket::AddressAndPort::AddressAndPort | ( | WORD | defaultPort, |
char | separator = ':' |
||
) |
PIPSocket::AddressAndPort::AddressAndPort | ( | const PString & | str, |
WORD | defaultPort = 0 , |
||
char | separator = ':' , |
||
const char * | proto = NULL |
||
) |
PIPSocket::AddressAndPort::AddressAndPort | ( | const PIPSocket::Address & | addr, |
WORD | defaultPort = 0 , |
||
char | separator = ':' |
||
) |
PIPSocket::AddressAndPort::AddressAndPort | ( | struct sockaddr * | ai_addr, |
const int | ai_addrlen | ||
) |
PString PIPSocket::AddressAndPort::AsString | ( | char | separator = 0 | ) | const |
|
inline |
References m_address.
Referenced by PMonitoredSocketChannel::GetLastReceived(), and PMonitoredSocketChannel::GetRemote().
|
inline |
References m_port.
Referenced by PMonitoredSocketChannel::GetLastReceived(), and PMonitoredSocketChannel::GetRemote().
|
inline |
References PIPSocket::Address::IsValid(), m_address, and m_port.
bool PIPSocket::AddressAndPort::MatchWildcard | ( | const AddressAndPort & | wild | ) | const |
|
inline |
|
inline |
bool PIPSocket::AddressAndPort::Parse | ( | const PString & | str, |
WORD | defaultPort = 0 , |
||
char | separator = ':' , |
||
const char * | proto = NULL |
||
) |
void PIPSocket::AddressAndPort::SetAddress | ( | const PIPSocket::Address & | addr, |
WORD | port = 0 |
||
) |
Referenced by PMonitoredSocketChannel::SetRemote().
|
inline |
References m_port, and PSocket::port.
|
friend |
|
protected |
Referenced by GetAddress(), IsValid(), operator!=(), and operator==().
|
protected |
Referenced by GetPort(), IsValid(), operator!=(), operator==(), and SetPort().
|
protected |