LogCabin
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions | Public Attributes
LogCabin::RPC::OpaqueServer::MessageSocketHandler Class Reference

Receives events from a MessageSocket. More...

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

List of all members.

Public Member Functions

 MessageSocketHandler (OpaqueServer *server)
void handleReceivedMessage (MessageId messageId, Core::Buffer message)
 This method is overridden by a subclass and invoked when a new message is received.
void handleDisconnect ()
 This method is overridden by a subclass and invoked when the socket has been disconnected and will be closed soon.
 MessageSocketHandler (const MessageSocketHandler &)
MessageSocketHandleroperator= (const MessageSocketHandler &)

Public Attributes

OpaqueServerserver
 The OpaqueServer which keeps a strong reference to this object, or NULL if the server has been/is being destroyed.
std::weak_ptr< SocketWithHandlerself
 A weak reference to this object, used to give OpaqueServerRPCs a way to send their replies back on their originating socket.

Detailed Description

Receives events from a MessageSocket.

Definition at line 121 of file OpaqueServer.h.


Constructor & Destructor Documentation

Definition at line 37 of file OpaqueServer.cc.


Member Function Documentation

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.

Implements LogCabin::RPC::MessageSocket::Handler.

Definition at line 44 of file OpaqueServer.cc.

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.

Implements LogCabin::RPC::MessageSocket::Handler.

Definition at line 86 of file OpaqueServer.cc.

MessageSocketHandler& LogCabin::RPC::OpaqueServer::MessageSocketHandler::operator= ( const MessageSocketHandler )

Member Data Documentation

The OpaqueServer which keeps a strong reference to this object, or NULL if the server has been/is being destroyed.

Used to invoke the server's rpcHandler when receiving an RPC request, or to drop the server's reference to this socket when disconnecting.

May only be accessed with an Event::Loop::Lock or from the event loop, since the OpaqueServer may set this to NULL under the same rules.

Definition at line 137 of file OpaqueServer.h.

A weak reference to this object, used to give OpaqueServerRPCs a way to send their replies back on their originating socket.

This may be empty when the SocketWithHandler is shutting down.

Definition at line 144 of file OpaqueServer.h.


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