LogCabin
|
This class is an Event::File monitor that calls writable() when the socket can be written to without blocking. More...
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 | |
MessageSocket & | messageSocket |
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.
LogCabin::RPC::MessageSocket::SendSocket::SendSocket | ( | int | fd, |
MessageSocket & | messageSocket | ||
) |
Definition at line 51 of file MessageSocket.cc.
Definition at line 66 of file MessageSocket.cc.
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).
events | Indicates 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.
Definition at line 160 of file MessageSocket.h.