#include <incoming.h>
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 |
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.
typedef std::vector<Connection*>::iterator ConnEventHandler::peer_iterator [private] |
Definition at line 82 of file incoming.h.
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().
void ConnEventHandler::add_peer | ( | const Connection * | peer | ) |
Definition at line 214 of file incoming.cc.
References peers.
Referenced by ConnEventHandler().
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.
Definition at line 226 of file incoming.cc.
References Messager::add_recipient(), and peers.
std::vector<Connection*> ConnEventHandler::peers [private] |