ConnEventHandler Class Reference

Provide an mechanism to know how to deal with incoming connections. More...

#include <incoming.h>

Collaboration diagram for ConnEventHandler:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 ConnEventHandler ()
 ConnEventHandler (const Connection *other_side)
void add_peer (const Connection *peer)
void operator() (Connection *)
 This function/functor method is invoked when a new connection is accepted.

Private Types

typedef std::vector
< Connection * >::iterator 
peer_iterator

Private Attributes

std::vector< Connection * > peers


Detailed Description

Provide an mechanism to know how to deal with incoming connections.

A generic interface class to perform any initialization on incoming Connections.

This is a generic interface for a handler that can be called by Incoming when the Listener it's attached to gets an incoming connection. This object can be called to handle any of the things that need to be done. This object is contructed by Listener's caller/invoker, who knows more than Listener does or should about what to do with the incoming Connections.

Note that we since Listeners now return new Connectors when new connections come in, we need to create a new Connection object for the Connector, and hook that up to the other_side. (Slight change to the old behavior.)

This will configure each of the BiDirConn's that are constructed as a result of Incoming waiting for incoming connections...

Definition at line 65 of file incoming.h.


Member Typedef Documentation

typedef std::vector<Connection*>::iterator ConnEventHandler::peer_iterator [private]

Definition at line 82 of file incoming.h.


Constructor & Destructor Documentation

ConnEventHandler::ConnEventHandler (  ) 

Definition at line 204 of file incoming.cc.

ConnEventHandler::ConnEventHandler ( const Connection other_side  ) 

Definition at line 207 of file incoming.cc.

References add_peer().

Here is the call graph for this function:


Member Function Documentation

void ConnEventHandler::add_peer ( const Connection peer  ) 

Definition at line 214 of file incoming.cc.

References peers.

Referenced by ConnEventHandler().

Here is the caller graph for this function:

void ConnEventHandler::operator() ( Connection new_conn  ) 

This function/functor method is invoked when a new connection is accepted.

It is called from Incoming::listener_thread for each incoming connection.

Todo:
listener_thread currently received Connector*'s, and it should probably be responsible for making Connection's out of them.

Definition at line 226 of file incoming.cc.

References Messager::add_recipient(), and peers.

Here is the call graph for this function:


Member Data Documentation

std::vector<Connection*> ConnEventHandler::peers [private]

Definition at line 81 of file incoming.h.

Referenced by add_peer(), and operator()().


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

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