#include <EchoServer.h>
Inheritance diagram for CODEX_Quorum::EchoServer:


Public Member Functions | |
| EchoServer (int port, const SocketBuilder &socketBuilder) | |
| Create a simple server that echoes back the data sent to it. | |
| virtual | ~EchoServer () |
| Virtual destructor. | |
| void | processRequest (SocketBase::StateType s) |
| Process incoming requests. | |
| virtual void | enable () |
| Create a socket and begin listening. | |
| virtual void | disable () |
| Stop listening and destroy the open socket. | |
| int | port () const |
| The port on which the server is listening. | |
| virtual int | set_fd (fd_set *fd_bitmap, SocketBase::StateType s) |
| Set the bitmap for this socket. | |
| virtual bool | isset_fd (const fd_set *fd_bitmap, SocketBase::StateType s) |
| Whether the bitmap is set for this socket. | |
Protected Member Functions | |
| SocketBase * | socket () const |
| Returns the socket on which this server is listening. | |
| const SocketBuilder & | builder () const |
| Returns the SocketBuilder for this server. | |
| void | setSocket (SocketBase *socket) |
| Set a SocketBase for this server. | |
This server blocks on new connections, so is not generally an appropriate component for a real system. It is, however, illustrative of putting things together.
Definition at line 32 of file EchoServer.h.
|
|
Returns the SocketBuilder for this server.
Definition at line 120 of file LocalServer.h. Referenced by CODEX_KeyService::ClientServer::processRequest(). |
|
|
Stop listening and destroy the open socket. Derived classes needing to clean up any state on shutdown should reimplement this method. This base-class version should be called explicitly, to ensure the necessary base class cleanup. Reimplemented in CODEX_Server::InternalVerifier. Definition at line 53 of file LocalServer.cc. Referenced by CODEX_Server::InternalVerifier::disable(). |
|
|
Create a socket and begin listening. Derived classes should reimplement this to perform other service initialization tasks needed. This base-class version should be called explicitly, to ensure the necessary base class initialization. Definition at line 41 of file LocalServer.cc. References CODEX_Quorum::SocketBase::setup(). |
|
||||||||||||
|
Whether the bitmap is set for this socket. Some types of sockets may need to know the operation being tested. Definition at line 76 of file LocalServer.cc. References CODEX_Quorum::SocketBase::isset_fd(). |
|
|
Process incoming requests. Derived classes must implement this routine, which is called whenever a connection is made.
Implements CODEX_Quorum::LocalServer. Definition at line 31 of file EchoServer.cc. References CODEX_Quorum::SocketBase::accept(), CODEX_Quorum::SocketBase::isset_fd(), CODEX_Quorum::SocketBase::readFrom(), CODEX_Quorum::SocketBase::set_fd(), CODEX_Quorum::LocalServer::socket(), and CODEX_Quorum::SocketBase::writeTo(). |
|
||||||||||||
|
Set the bitmap for this socket. Some types of sockets may need to know the operation being tested. Definition at line 69 of file LocalServer.cc. References CODEX_Quorum::SocketBase::set_fd(). |
|
|
Set a SocketBase for this server. Useful for servers that clone themselves. Definition at line 126 of file LocalServer.h. References CODEX_Quorum::LocalServer::socket(). Referenced by CODEX_KeyService::ClientActivity::ClientActivity(), and CODEX_Server::InternalVerifier::InternalVerifier(). |
1.4.1