LogCabin
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Types | Public Member Functions
LogCabin::RPC::MessageSocket::Handler Class Reference

An interface for handling events generated by a MessageSocket. More...

#include <MessageSocket.h>

Inheritance diagram for LogCabin::RPC::MessageSocket::Handler:
LogCabin::RPC::ClientSession::MessageSocketHandler LogCabin::RPC::OpaqueServer::MessageSocketHandler

List of all members.

Public Types

typedef MessageSocket::MessageId MessageId

Public Member Functions

virtual ~Handler ()
 Destructor.
virtual void handleReceivedMessage (MessageId messageId, Core::Buffer contents)=0
 This method is overridden by a subclass and invoked when a new message is received.
virtual void handleDisconnect ()=0
 This method is overridden by a subclass and invoked when the socket has been disconnected and will be closed soon.

Detailed Description

An interface for handling events generated by a MessageSocket.

The Handler's lifetime must outlive that of the MessageSocket.

Definition at line 65 of file MessageSocket.h.


Member Typedef Documentation

Definition at line 67 of file MessageSocket.h.


Constructor & Destructor Documentation

virtual LogCabin::RPC::MessageSocket::Handler::~Handler ( ) [inline, virtual]

Destructor.

Definition at line 72 of file MessageSocket.h.


Member Function Documentation

virtual void LogCabin::RPC::MessageSocket::Handler::handleReceivedMessage ( MessageId  messageId,
Core::Buffer  contents 
) [pure virtual]

This method is overridden by a subclass and invoked when a new message is received.

This method will be invoked by the main event loop on whatever thread is running the Event::Loop.

Parameters:
messageIdAn opaque identifier for the message set by the sender.
contentsThe data received.

Implemented in LogCabin::RPC::ClientSession::MessageSocketHandler, and LogCabin::RPC::OpaqueServer::MessageSocketHandler.

This method is overridden by a subclass and invoked when the socket has been disconnected and will be closed soon.

It is safe to destroy the MessageSocket during this call. This method will be invoked by the main event loop at any time on whatever thread is running the Event::Loop.

Note that MessageSocket::close() calls this method as well, even if it's already been called.

Implemented in LogCabin::RPC::ClientSession::MessageSocketHandler, and LogCabin::RPC::OpaqueServer::MessageSocketHandler.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines