|
libassa
3.5.1
|
#include <ServiceHandler.h>
Public Member Functions | |
| ServiceHandler () | |
| Default constructor. More... | |
| ServiceHandler (PEER_STREAM *ps_) | |
| Constructor that takes PEER_STREAM as a parameter. More... | |
| virtual | ~ServiceHandler () |
| Destructor closes and deletes PEER_STREAM. More... | |
| virtual int | open (void)=0 |
| Pure virtual method defined by subclass. More... | |
| virtual void | close (void) |
| Pure virtual method defined by subclass. More... | |
| operator PEER_STREAM & () | |
| Conversion operator to type PEER_STREAM &. More... | |
| PEER_STREAM & | get_stream () |
| Return referenct to underlying PEER_STREAM. More... | |
Public Member Functions inherited from ASSA::EventHandler | |
| EventHandler () | |
| Constructor. More... | |
| virtual | ~EventHandler () |
| Virtual destructor. More... | |
| virtual int | handle_read (int fd) |
| Read event callback. More... | |
| virtual int | handle_write (int fd) |
| Write handler callback. More... | |
| virtual int | handle_except (int fd) |
| Exception handler callback. More... | |
| virtual int | handle_timeout (TimerId tid) |
| Timeout handler callback. More... | |
| virtual int | handle_signal (int signum_) |
| Signal handler callback. More... | |
| virtual int | handle_close (int fd) |
| EOF on peer socket handler callback. More... | |
| virtual void | resetState (void) |
| A hook for derived class to reset internal state as needed. More... | |
| void | set_id (const std::string &id_) |
| Set EventHandler ID. More... | |
| std::string | get_id () const |
| Retrieve EventHandler ID. More... | |
Protected Attributes | |
| PEER_STREAM * | m_peerStream |
| Concrete Socket instance. More... | |
Protected Attributes inherited from ASSA::EventHandler | |
| std::string | m_id |
Definition at line 31 of file ServiceHandler.h.
|
inline |
Default constructor.
In case of server-side, ServiceHandler is created by Acceptor, when new connection is detected.
Definition at line 38 of file ServiceHandler.h.
|
inline |
Constructor that takes PEER_STREAM as a parameter.
In case of server-side, ServiceHandler is created by Acceptor, when new connection is detected. Note that PEER_STREAM is created by PEER_STREAM::accept () method.
Definition at line 49 of file ServiceHandler.h.
|
inlinevirtual |
Destructor closes and deletes PEER_STREAM.
Definition at line 56 of file ServiceHandler.h.
|
inlinevirtual |
Pure virtual method defined by subclass.
The close() hook closes PEER_STREAM by default The behavior of this method can be changed by a subclass, which typically performs any service-specific cleanup. EventHandler::handle_close() method of base class EventHandler is called when client closes connection. ServiceHandler object can destroy itself from there.
Definition at line 81 of file ServiceHandler.h.
|
inline |
Return referenct to underlying PEER_STREAM.
Definition at line 100 of file ServiceHandler.h.
|
pure virtual |
Pure virtual method defined by subclass.
The open() hook is called by the Acceptor or Connector once a connection is established. The behavior of this method must be defined by a subclass, which typically performs any service-specific initialization.
Implemented in ASSA::RemoteLogger.
Referenced by ASSA::ServiceHandler< ASSA::IPv4Socket >::~ServiceHandler().
|
inline |
Conversion operator to type PEER_STREAM &.
Comes handy when you want to call underlying PEER_STREAM member functions directly.
Definition at line 93 of file ServiceHandler.h.
References ASSA::ServiceHandler< PEER_STREAM >::m_peerStream.
|
protected |
Concrete Socket instance.
ServiceHandler owns this object which is delete()-ed in destructor.
Definition at line 106 of file ServiceHandler.h.
Referenced by ASSA::ServiceHandler< ASSA::IPv4Socket >::close(), ASSA::ServiceHandler< ASSA::IPv4Socket >::get_stream(), ASSA::ServiceHandler< PEER_STREAM >::operator PEER_STREAM &(), and ASSA::ServiceHandler< ASSA::IPv4Socket >::~ServiceHandler().
1.8.13