|
| KQueueEngine () |
|
virtual | ~KQueueEngine () |
|
bool | AddFd (EventHandler *eh, int event_mask) |
|
void | OnSetEvent (EventHandler *eh, int old_mask, int new_mask) |
|
virtual void | DelFd (EventHandler *eh) |
|
virtual int | DispatchEvents () |
|
virtual std::string | GetName () |
|
virtual void | RecoverFromFork () |
|
| SocketEngine () |
|
virtual | ~SocketEngine () |
|
void | ChangeEventMask (EventHandler *eh, int event_mask) |
|
int | GetMaxFds () const |
|
int | GetUsedFds () const |
|
virtual bool | HasFd (int fd) |
|
virtual EventHandler * | GetRef (int fd) |
|
virtual void | DispatchTrialWrites () |
|
virtual bool | BoundsCheckFd (EventHandler *eh) |
|
int | Accept (EventHandler *fd, sockaddr *addr, socklen_t *addrlen) |
|
int | Close (EventHandler *fd) |
|
int | Close (int fd) |
|
int | Send (EventHandler *fd, const void *buf, size_t len, int flags) |
|
int | Recv (EventHandler *fd, void *buf, size_t len, int flags) |
|
int | RecvFrom (EventHandler *fd, void *buf, size_t len, int flags, sockaddr *from, socklen_t *fromlen) |
|
int | SendTo (EventHandler *fd, const void *buf, size_t len, int flags, const sockaddr *to, socklen_t tolen) |
|
int | Connect (EventHandler *fd, const sockaddr *serv_addr, socklen_t addrlen) |
|
int | Blocking (int fd) |
|
int | NonBlocking (int fd) |
|
int | Shutdown (EventHandler *fd, int how) |
|
int | Shutdown (int fd, int how) |
|
int | Bind (int fd, const irc::sockets::sockaddrs &addr) |
|
int | Listen (int sockfd, int backlog) |
|
void | SetReuse (int sockfd) |
|
void | GetStats (float &kbitpersec_in, float &kbitpersec_out, float &kbitpersec_total) |
|
|
static bool | IgnoreError () |
|
static std::string | LastError () |
|
static std::string | GetError (int errnum) |
|
unsigned long | TotalEvents |
|
unsigned long | ReadEvents |
|
unsigned long | WriteEvents |
|
unsigned long | ErrorEvents |
|
void | UpdateStats (size_t len_in, size_t len_out) |
|
void | SetEventMask (EventHandler *eh, int value) |
|
int | CurrentSetSize |
|
EventHandler ** | ref |
|
std::set< int > | trials |
|
int | MAX_DESCRIPTORS |
|
size_t | indata |
|
size_t | outdata |
|
time_t | lastempty |
|
A specialisation of the SocketEngine class, designed to use BSD kqueue().
◆ KQueueEngine()
KQueueEngine::KQueueEngine |
( |
| ) |
|
◆ ~KQueueEngine()
KQueueEngine::~KQueueEngine |
( |
| ) |
|
|
virtual |
◆ AddFd()
bool KQueueEngine::AddFd |
( |
EventHandler * |
eh, |
|
|
int |
event_mask |
|
) |
| |
|
virtual |
Add an EventHandler object to the engine. Use AddFd to add a file descriptor to the engine and have the socket engine monitor it. You must provide an object derived from EventHandler which implements HandleEvent().
- Parameters
-
eh | An event handling object to add |
event_mask | The initial event mask for the object |
Implements SocketEngine.
◆ DelFd()
Delete an event handler from the engine. This function call deletes an EventHandler from the engine, returning true if it succeeded and false if it failed. This does not free the EventHandler pointer using delete, if this is required you must do this yourself.
- Parameters
-
eh | The event handler object to remove |
Implements SocketEngine.
◆ DispatchEvents()
int KQueueEngine::DispatchEvents |
( |
| ) |
|
|
virtual |
Waits for events and dispatches them to handlers. Please note that this doesn't wait long, only a couple of milliseconds. It returns the number of events which occurred during this call. This method will dispatch events to their handlers by calling their EventHandler::HandleEvent() methods with the necessary EventType value.
- Returns
- The number of events which have occured.
Implements SocketEngine.
◆ GetName()
std::string KQueueEngine::GetName |
( |
| ) |
|
|
virtual |
Returns the socket engines name. This returns the name of the engine for use in /VERSION responses.
- Returns
- The socket engine name
Implements SocketEngine.
◆ RecoverFromFork()
void KQueueEngine::RecoverFromFork |
( |
| ) |
|
|
virtual |
This function is called immediately after fork(). Some socket engines (notably kqueue) cannot have their handles inherited by forked processes. This method allows for the socket engine to re-create its handle after the daemon forks as the socket engine is created long BEFORE the daemon forks.
- Returns
- void, but it is acceptable for this function to bail back to the shell or operating system on fatal error.
Reimplemented from SocketEngine.
The documentation for this class was generated from the following file:
- src/socketengines/socketengine_kqueue.cpp