Public Types | |
typedef unsigned long | Address |
typedef unsigned short | Port |
Public Member Functions | |
CAddressIPv4 () | |
Creates a CAddressIPv4 object that represents the IPv4 wilcard address, i.e. INADDR_ANY and port 0. | |
CAddressIPv4 (const CAddress &address) | |
Creates a CAddressIPv4 object which is a copy of the supplied address. Note that the address family for the supplied address must be AF_INET or an exception will be thrown. This constructor can be used to convert the correct type of 'generic Winsock Address' back into a full IPv4 address, so, for example, you could take the remote address of a socket connection and initiate a new outgoing connection to it because you have an instance of IFullAddress. | |
CAddressIPv4 (const sockaddr_in &address) | |
Creates a CAddressIPv4 object which is a copy of the supplied address. | |
CAddressIPv4 (Address address, Port port) | |
Creates a CAddressIPv4 object with the supplied address and port. | |
CAddressIPv4 (const JetByteTools::Core::_tstring &dottedIPorName, Port port) | |
Creates a CAddressIPv4 object from the supplied address in dotted ip format "xxx.xxx.xxx.xxx" and a port. | |
CAddressIPv4 (const JetByteTools::Core::_tstring &addressAsString) | |
Creates a CAddressIPv4 object from the supplied address in the following string format: "xxx.xxx.xxx.xxx:port". | |
Address | GetAddress () const |
Returns the address. | |
Port | GetPort () const override |
Returns the port. | |
const IAddressType & | Type () const override |
Returns the address type for the address. | |
IFullAddress * | Clone () const override |
Dynamically allocates a copy of this address. You are responsible for deallocating this copy with delete when you're done with it.. | |
bool | IsWildcardAddress () const override |
unsigned short | Family () const override |
Returns the address family of the address. | |
const sockaddr & | AsSockAddr () const override |
Returns the address as a reference to a sockaddr structure. | |
int | Size () const override |
Returns the size of the sockaddr structure required to store the address. | |
IAddressRef * | GetAddressRef () const override |
Returns a reference counted view on this address, be sure to call Release() on the IAdressRef when you're done with it. | |
Static Public Member Functions | |
static Port | GetPort (const IAddress &address) |
static Port | GetPort (const sockaddr &address, int addressLength) |
static bool | TryGetPort (const IAddress &address, Port &port) |
static bool | TryGetPort (const sockaddr &address, int addressLength, Port &port) |
static bool | IsValid (const IAddress &address) |
static bool | IsSameAddress (const IAddress &lhs, const IAddress &rhs) |
typedef unsigned long Address |
typedef unsigned short Port [inherited] |
CAddressIPv4 | ( | ) |
Creates a CAddressIPv4 object that represents the IPv4 wilcard address, i.e. INADDR_ANY and port 0.
CAddressIPv4 | ( | const CAddress & | address | ) | [explicit] |
Creates a CAddressIPv4 object which is a copy of the supplied address. Note that the address family for the supplied address must be AF_INET or an exception will be thrown. This constructor can be used to convert the correct type of 'generic Winsock Address' back into a full IPv4 address, so, for example, you could take the remote address of a socket connection and initiate a new outgoing connection to it because you have an instance of IFullAddress.
CAddressIPv4 | ( | const sockaddr_in & | address | ) | [explicit] |
Creates a CAddressIPv4 object which is a copy of the supplied address.
CAddressIPv4 | ( | Address | address, | |
Port | port | |||
) |
Creates a CAddressIPv4 object with the supplied address and port.
CAddressIPv4 | ( | const JetByteTools::Core::_tstring & | dottedIPorName, | |
Port | port | |||
) |
Creates a CAddressIPv4 object from the supplied address in dotted ip format "xxx.xxx.xxx.xxx" and a port.
CAddressIPv4 | ( | const JetByteTools::Core::_tstring & | addressAsString | ) | [explicit] |
Creates a CAddressIPv4 object from the supplied address in the following string format: "xxx.xxx.xxx.xxx:port".
CAddressIPv4::Address GetAddress | ( | ) | const |
Returns the address.
IIPAddress::Port GetPort | ( | ) | const [override, virtual] |
const IAddressType & Type | ( | ) | const [override, virtual] |
IFullAddress * Clone | ( | ) | const [override, virtual] |
Dynamically allocates a copy of this address. You are responsible for deallocating this copy with delete when you're done with it..
Implements IFullAddress.
bool IsWildcardAddress | ( | ) | const [override, virtual] |
Implements IFullAddress.
unsigned short Family | ( | ) | const [override, virtual] |
const sockaddr & AsSockAddr | ( | ) | const [override, virtual] |
int Size | ( | ) | const [override, virtual] |
IAddressRef * GetAddressRef | ( | ) | const [override, virtual] |
Returns a reference counted view on this address, be sure to call Release() on the IAdressRef when you're done with it.
Implements IAddress.
IIPAddress::Port GetPort | ( | const IAddress & | address | ) | [static, inherited] |
IIPAddress::Port GetPort | ( | const sockaddr & | address, | |
int | addressLength | |||
) | [static, inherited] |
bool TryGetPort | ( | const IAddress & | address, | |
IIPAddress::Port & | port | |||
) | [static, inherited] |