#include <daytime.h>
Public Member Functions | |
virtual | ~endpoint_listener_daytime () |
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_daytime (reactor &svc, const std::string &port_number, int repeat_count=-1) | |
endpoint_listener_daytime () | |
endpoint_listener_daytime (const endpoint_listener_daytime &rhs) | |
endpoint_listener_daytime & | operator= (const endpoint_listener_daytime &rhs) |
The plumbing::endpoint_listener_daytime class is used to represent a socket that listens for connections, and spawns plumbing::endpoint_daytime objects to serve those new connections.
Definition at line 30 of file daytime.h.
plumbing::endpoint_listener_daytime::~endpoint_listener_daytime | ( | ) | [virtual] |
The destructor.
Definition at line 22 of file daytime.cc.
plumbing::endpoint_listener_daytime::endpoint_listener_daytime | ( | 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 daytime.cc.
plumbing::endpoint_listener_daytime::endpoint_listener_daytime | ( | ) | [private] |
The default constructor. Do not use.
plumbing::endpoint_listener_daytime::endpoint_listener_daytime | ( | const endpoint_listener_daytime & | rhs | ) | [private] |
The copy constructor. Do not use.
rhs | The right hand side of the initialisation. |
plumbing::endpoint::pointer plumbing::endpoint_listener_daytime::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 daytime.cc.
plumbing::endpoint::pointer plumbing::endpoint_listener_daytime::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 daytime.cc.
int plumbing::endpoint_listener_daytime::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 daytime.cc.
endpoint_listener_daytime& plumbing::endpoint_listener_daytime::operator= | ( | const endpoint_listener_daytime & | rhs | ) | [private] |
The assignment operator. Do not use.
rhs | The rights hand side of the assignment. |