The C++ framework for developing highly scalable, high performance servers on Windows platforms.

CAddressIPv4 Class Reference
[Addresses]

Inheritance diagram for CAddressIPv4:
Collaboration diagram for CAddressIPv4:

List of all members.


Detailed Description

An IPv4 address.


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 IAddressTypeType () const override
 Returns the address type for the address.
IFullAddressClone () 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.
IAddressRefGetAddressRef () 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)


Member Typedef Documentation

typedef unsigned long Address

typedef unsigned short Port [inherited]


Constructor & Destructor Documentation

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".


Member Function Documentation

CAddressIPv4::Address GetAddress (  )  const

Returns the address.

IIPAddress::Port GetPort (  )  const [override, virtual]

Returns the port.

Implements IIPAddress.

const IAddressType & Type (  )  const [override, virtual]

Returns the address type for the address.

Implements IFullAddress.

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]

Returns the address family of the address.

Implements IAddress.

const sockaddr & AsSockAddr (  )  const [override, virtual]

Returns the address as a reference to a sockaddr structure.

Implements IAddress.

int Size (  )  const [override, virtual]

Returns the size of the sockaddr structure required to store the address.

Implements IAddress.

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]

bool TryGetPort ( const sockaddr &  address,
int  addressLength,
Port port 
) [static, inherited]

bool IsValid ( const IAddress address  )  [static, inherited]

bool IsSameAddress ( const IAddress lhs,
const IAddress rhs 
) [static, inherited]


Generated on Sun Sep 12 19:10:01 2021 for The Server Framework - v7.4 by doxygen 1.5.3