LogCabin
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions | Private Attributes
LogCabin::RPC::MessageSocket::SendSocket Struct Reference

This class is an Event::File monitor that calls writable() when the socket can be written to without blocking. More...

Inheritance diagram for LogCabin::RPC::MessageSocket::SendSocket:
LogCabin::Event::File

List of all members.

Public Member Functions

 SendSocket (int fd, MessageSocket &messageSocket)
 ~SendSocket ()
void handleFileEvent (uint32_t events)
 This method is overridden by a subclass and invoked when a file event occurs.

Private Attributes

MessageSocketmessageSocket

Detailed Description

This class is an Event::File monitor that calls writable() when the socket can be written to without blocking.

When there are messages to be sent out, it is set to EPOLLOUT|EPOLLONESHOT.

Since ReceiveSocket is more efficient when one-shot is not used, and SendSocket is more efficient when one-shot is used, the two are monitored as separate Event::File objects.

Definition at line 154 of file MessageSocket.h.


Constructor & Destructor Documentation

Definition at line 51 of file MessageSocket.cc.

Definition at line 66 of file MessageSocket.cc.


Member Function Documentation

void LogCabin::RPC::MessageSocket::SendSocket::handleFileEvent ( uint32_t  events) [virtual]

This method is overridden by a subclass and invoked when a file event occurs.

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

If the event still exists when this method returns (e.g., the file is readable but the method did not read the data), then the method will be invoked again (unless flags such as EPOLLONESHOT or EPOLLET are used).

Parameters:
eventsIndicates whether the file is readable or writable or both (OR'ed combination of EPOLL_EVENTS values).

Implements LogCabin::Event::File.

Definition at line 71 of file MessageSocket.cc.


Member Data Documentation

Definition at line 160 of file MessageSocket.h.


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