SocketConnector Class Reference
[Connector implementation classes and data]

An abstract class describing connections over any type of socket. More...

#include <sockconn.h>

Inheritance diagram for SocketConnector:

Inheritance graph
[legend]
Collaboration diagram for SocketConnector:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 SocketConnector (SocketAddressP &address)
 Construct a SocketConnector.
virtual void connect ()
 Connect to the socket.
std::string get_id () const
 Generate an ID string to indicate what we're connected to.

Protected Attributes

SocketAddressP sock_addr
 Address of the socket we're connected to.

Related Functions

(Note that these are not member functions.)

struct sockaddr * build_addr (Config &conf)


Detailed Description

An abstract class describing connections over any type of socket.

It knows how to connect to a socket (the address of which is stored internally as a struct sockaddr*), disconnect, and read and write on the socket. It will send a disconnection notification Message to the specified owner object when the socket is closed.

Definition at line 63 of file sockconn.h.


Constructor & Destructor Documentation

SocketConnector::SocketConnector ( SocketAddressP address  ) 

Construct a SocketConnector.

The type of connector will be determined by the subclass of SocketAddress that's passed into this constructor.

Definition at line 54 of file sockconn.cc.

References connect().

Here is the call graph for this function:


Member Function Documentation

void SocketConnector::connect ( void   )  [virtual]

Connect to the socket.

Todo:
SocketConnector::connect should be able to call bind() so connections can be initiated from a specific address, if/when desired.

Definition at line 73 of file sockconn.cc.

References FDConnector::connect(), and sock_addr.

Referenced by SocketConnector().

Here is the call graph for this function:

Here is the caller graph for this function:

std::string SocketConnector::get_id ( void   )  const [virtual]

Generate an ID string to indicate what we're connected to.

Reimplemented from FDConnector.

Definition at line 119 of file sockconn.cc.

References sock_addr.


Friends And Related Function Documentation

struct sockaddr * build_addr ( Config conf  )  [related]

Get the address [and port] from the Config object passed in, and build a sockaddr from them.

Definition at line 75 of file misc.cc.


Member Data Documentation

Address of the socket we're connected to.

Definition at line 78 of file sockconn.h.

Referenced by connect(), and get_id().


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

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