InspIRCd
2.0
|
Public Member Functions | |
EPollEngine () | |
virtual | ~EPollEngine () |
virtual bool | AddFd (EventHandler *eh, int event_mask) |
virtual void | OnSetEvent (EventHandler *eh, int old_mask, int new_mask) |
virtual void | DelFd (EventHandler *eh) |
virtual int | DispatchEvents () |
virtual std::string | GetName () |
![]() | |
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) |
virtual void | RecoverFromFork () |
void | GetStats (float &kbitpersec_in, float &kbitpersec_out, float &kbitpersec_total) |
Additional Inherited Members | |
![]() | |
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 linux 2.6 epoll().
EPollEngine::EPollEngine | ( | ) |
Create a new EPollEngine
|
virtual |
Delete an EPollEngine
|
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().
eh | An event handling object to add |
event_mask | The initial event mask for the object |
Implements SocketEngine.
|
virtual |
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.
eh | The event handler object to remove |
Implements SocketEngine.
|
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.
Implements SocketEngine.
|
virtual |
Returns the socket engines name. This returns the name of the engine for use in /VERSION responses.
Implements SocketEngine.