#include <chargen.h>
Public Member Functions | |
virtual | ~endpoint_listener_chargen () |
Static Public Member Functions | |
static pointer | create (reactor &svc, const std::string &port_number="", int repeat_count=-1) |
Protected Member Functions | |
int | get_default_port () const |
endpoint::pointer | endpoint_factory (int fd, void *adr, int adrlen) |
Private Member Functions | |
endpoint_listener_chargen (reactor &svc, const std::string &port_number, int repeat_count=-1) | |
endpoint_listener_chargen () | |
endpoint_listener_chargen (const endpoint_listener_chargen &rhs) | |
endpoint_listener_chargen & | operator= (const endpoint_listener_chargen &rhs) |
The plumbing::endpoint_listener_chargen class is used to represent a socket that listens for connections, and spawns plumbing::endpoint_chargen objects to serve those new connections.
Definition at line 31 of file chargen.h.
plumbing::endpoint_listener_chargen::~endpoint_listener_chargen | ( | ) | [virtual] |
The destructor.
Definition at line 22 of file chargen.cc.
plumbing::endpoint_listener_chargen::endpoint_listener_chargen | ( | reactor & | svc, | |
const std::string & | port_number, | |||
int | repeat_count = -1 | |||
) | [private] |
The constructor. It is private on purpse, use the create class method instead.
svc | The reactor to manage all new connections. | |
port_number | The numer of the port to use, or the empty string if it should use the well known port. | |
repeat_count | The number of time to spawn servers before self terminating. Use -1 to mean "infinity". |
Definition at line 27 of file chargen.cc.
plumbing::endpoint_listener_chargen::endpoint_listener_chargen | ( | ) | [private] |
The default constructor. Do not use.
plumbing::endpoint_listener_chargen::endpoint_listener_chargen | ( | const endpoint_listener_chargen & | rhs | ) | [private] |
The copy constructor. Do not use.
rhs | The right hand side of the initialisation. |
plumbing::endpoint::pointer plumbing::endpoint_listener_chargen::create | ( | reactor & | svc, | |
const std::string & | port_number = "" , |
|||
int | repeat_count = -1 | |||
) | [static] |
The create class method is used to create new dynamically allocated instances of this class.
svc | The reactor to manage all new connections. | |
port_number | The numer of the port to use, or the empty string if it should use the well known port. | |
repeat_count | The number of time to spawn servers before self terminating. Use -1 to mean "infinity". |
Definition at line 35 of file chargen.cc.
plumbing::endpoint::pointer plumbing::endpoint_listener_chargen::endpoint_factory | ( | int | fd, | |
void * | adr, | |||
int | adrlen | |||
) | [protected, virtual] |
The endpoint_factory method is call in response to a successful connection by a client.
fd | The file descriptor of the new connnection | |
adr | The address data structure returned by accept | |
adrlen | The length of the address data structure returned by accept |
Implements plumbing::endpoint_listener.
Definition at line 56 of file chargen.cc.
int plumbing::endpoint_listener_chargen::get_default_port | ( | ) | const [protected, virtual] |
The get_default_port method is used to obtain the port number this reactor will listen on, if not port is specified in the configuration file. Each drived class must supply its own default port.
Implements plumbing::endpoint_listener.
Definition at line 47 of file chargen.cc.
endpoint_listener_chargen& plumbing::endpoint_listener_chargen::operator= | ( | const endpoint_listener_chargen & | rhs | ) | [private] |
The assignment operator. Do not use.
rhs | The rights hand side of the assignment. |