IPSocketAddress Class Reference
[Socket address data structure and methodology]

A SocketAddress for holding an IP address/port. More...

#include <ipsockaddr.h>

Inheritance diagram for IPSocketAddress:

Inheritance graph
[legend]
Collaboration diagram for IPSocketAddress:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 IPSocketAddress (const struct sockaddr *initaddr)
 IPSocketAddress (const std::string &address, int port)
 Instantiate a new IPSocketAddress given an address and port.
 ~IPSocketAddress ()
u_short port () const
 Return the port number stored in this IPSocketAddress.
std::string get_id () const


Detailed Description

A SocketAddress for holding an IP address/port.

This code acts as a wrapper around sockaddr_in and sockaddr_in6, and knows internally how to deal with the IPv6 vs. IPv6 issues. The storage, of course, is the sockaddr_storage (SocketAddress::addr) inherited from our parent class.

Definition at line 59 of file ipsockaddr.h.


Constructor & Destructor Documentation

IPSocketAddress::IPSocketAddress ( const struct sockaddr *  initaddr  )  [inline]

Definition at line 61 of file ipsockaddr.h.

IPSocketAddress::IPSocketAddress ( const std::string &  address,
int  port 
)

Instantiate a new IPSocketAddress given an address and port.

This takes an IP address and [optional?] port number and initialized this SocketAddress.

Note:
This doesn't handle hostnames, only printable-form IP addresses.

Definition at line 61 of file ipsockaddr.cc.

References SocketAddress::set_addr().

Here is the call graph for this function:

IPSocketAddress::~IPSocketAddress (  ) 

Definition at line 109 of file ipsockaddr.cc.


Member Function Documentation

u_short IPSocketAddress::port (  )  const

Return the port number stored in this IPSocketAddress.

Definition at line 120 of file ipsockaddr.cc.

References SocketAddress::addr, and SocketAddress::family().

Referenced by get_id(), and socket_sender().

Here is the call graph for this function:

Here is the caller graph for this function:

string IPSocketAddress::get_id ( void   )  const [virtual]

Implements SocketAddress.

Definition at line 143 of file ipsockaddr.cc.

References SocketAddress::addr, SocketAddress::family(), port(), and SocketAddress::sock_addrlen.

Here is the call graph for this function:


The documentation for this class was generated from the following files:

Generated on Tue May 13 11:32:47 2008 for consmgr by  doxygen 1.5.5