JetByteTools::Socket::CAddressIPv4 Class Reference
[Addresses]

Inherits JetByteTools::Socket::IFullAddress.

Inheritance diagram for JetByteTools::Socket::CAddressIPv4:

Inheritance graph
[legend]
Collaboration diagram for JetByteTools::Socket::CAddressIPv4:

Collaboration graph
[legend]
List of all members.

Detailed Description

An IPv4 address.


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 (const unsigned long address, const unsigned short port)
 Creates a CAddressIPv4 object with the supplied address and port.
 CAddressIPv4 (const JetByteTools::Win32::_tstring &dottedIPorName, const unsigned short port)
 Creates a CAddressIPv4 object from the supplied address in dotted ip format "xxx.xxx.xxx.xxx" and a port.
 CAddressIPv4 (const JetByteTools::Win32::_tstring &addressAsString)
 Creates a CAddressIPv4 object from the supplied address in the following string format: "xxx.xxx.xxx.xxx:port".
unsigned long Address () const
 Returns the address.
unsigned short Port () const
 Returns the port.
virtual const IAddressTypeType () const
 Returns the address type for the address.
virtual IFullAddressClone () const
 Dynamically allocates a copy of this address. You are responsible for deallocating this copy with delete when you're done with it..
virtual short Family () const
 Returns the address family of the address.
virtual const sockaddr & AsSockAddr () const
 Returns the address as a reference to a sockaddr structure.
virtual int Size () const
 Returns the size of the sockaddr structure required to store the address.
virtual IAddressRefGetAddressRef () const
 Returns a reference counted view on this address, be sure to call Release() on the IAdressRef when you're done with it.


Constructor & Destructor Documentation

JetByteTools::Socket::CAddressIPv4::CAddressIPv4 (  ) 

Creates a CAddressIPv4 object that represents the IPv4 wilcard address, i.e. INADDR_ANY and port 0.

JetByteTools::Socket::CAddressIPv4::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.

JetByteTools::Socket::CAddressIPv4::CAddressIPv4 ( const sockaddr_in &  address  )  [explicit]

Creates a CAddressIPv4 object which is a copy of the supplied address.

JetByteTools::Socket::CAddressIPv4::CAddressIPv4 ( const unsigned long  address,
const unsigned short  port 
)

Creates a CAddressIPv4 object with the supplied address and port.

JetByteTools::Socket::CAddressIPv4::CAddressIPv4 ( const JetByteTools::Win32::_tstring dottedIPorName,
const unsigned short  port 
)

Creates a CAddressIPv4 object from the supplied address in dotted ip format "xxx.xxx.xxx.xxx" and a port.

JetByteTools::Socket::CAddressIPv4::CAddressIPv4 ( const JetByteTools::Win32::_tstring addressAsString  ) 

Creates a CAddressIPv4 object from the supplied address in the following string format: "xxx.xxx.xxx.xxx:port".


Member Function Documentation

unsigned long JetByteTools::Socket::CAddressIPv4::Address (  )  const

Returns the address.

unsigned short JetByteTools::Socket::CAddressIPv4::Port (  )  const

Returns the port.

const IAddressType & JetByteTools::Socket::CAddressIPv4::Type (  )  const [virtual]

Returns the address type for the address.

Implements JetByteTools::Socket::IFullAddress.

IFullAddress * JetByteTools::Socket::CAddressIPv4::Clone (  )  const [virtual]

Dynamically allocates a copy of this address. You are responsible for deallocating this copy with delete when you're done with it..

Implements JetByteTools::Socket::IFullAddress.

short JetByteTools::Socket::CAddressIPv4::Family (  )  const [virtual]

Returns the address family of the address.

Implements JetByteTools::Socket::IAddress.

const sockaddr & JetByteTools::Socket::CAddressIPv4::AsSockAddr (  )  const [virtual]

Returns the address as a reference to a sockaddr structure.

Implements JetByteTools::Socket::IAddress.

int JetByteTools::Socket::CAddressIPv4::Size (  )  const [virtual]

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

Implements JetByteTools::Socket::IAddress.

IAddressRef * JetByteTools::Socket::CAddressIPv4::GetAddressRef (  )  const [virtual]

Returns a reference counted view on this address, be sure to call Release() on the IAdressRef when you're done with it.

Implements JetByteTools::Socket::IAddress.


Generated on Tue May 8 17:47:57 2007 for JetByte Socket Tools by  doxygen 1.5.2