#include <socketengine.h>
This class is a basic I/O handler class. Any object which wishes to receive basic I/O events from the socketengine must derive from this class and implement the OnEventHandler*() methods. The derived class must then be added to SocketEngine using the method SocketEngine::AddFd(), after which point the derived class will receive events to its OnEventHandler*() methods. The event mask passed to SocketEngine::AddFd() determines what events the EventHandler gets notified about and with what semantics. SocketEngine::ChangeEventMask() can be called to update the event mask later. The only requirement beyond this for an event handler is that it must have a file descriptor. What this file descriptor is actually attached to is completely up to you.
◆ EventHandler()
EventHandler::EventHandler |
( |
| ) |
|
◆ ~EventHandler()
virtual EventHandler::~EventHandler |
( |
| ) |
|
|
inlinevirtual |
◆ GetFd()
int EventHandler::GetFd |
( |
| ) |
const |
|
inline |
Get the current file descriptor
- Returns
- The file descriptor of this handler
◆ HasFd()
bool EventHandler::HasFd |
( |
| ) |
const |
|
inline |
Checks if this event handler has a fd associated with it.
◆ OnEventHandlerError()
void EventHandler::OnEventHandlerError |
( |
int |
errornum | ) |
|
|
virtual |
Called by the socket engine in case of an error event. The default implementation does nothing.
- Parameters
-
Reimplemented in StreamSocket, and ThreadSignalSocket.
◆ OnEventHandlerRead()
virtual void EventHandler::OnEventHandlerRead |
( |
| ) |
|
|
pure virtual |
◆ OnEventHandlerWrite()
void EventHandler::OnEventHandlerWrite |
( |
| ) |
|
|
virtual |
◆ SetFd()
void EventHandler::SetFd |
( |
int |
FD | ) |
|
Set a new file descriptor
- Parameters
-
FD | The new file descriptor. Do not call this method without first deleting the object from the SocketEngine if you have added it to a SocketEngine instance. |
◆ SwapInternals()
Swaps the internals of this EventHandler with another one.
- Parameters
-
◆ fd
File descriptor. All events which can be handled must have a file descriptor. This allows you to add events for sockets, fifo's, pipes, and various other forms of IPC. Do not change this while the object is registered with the SocketEngine
The documentation for this class was generated from the following files: