Encapsulates the EPoll interface. More...
#include <tcpsocket.h>
Public Member Functions | |
EPoll () | |
Constructor. | |
~EPoll () | |
Destructor. | |
void | poll (int timeout) |
Call poll() regularly to respond to network events. More... | |
Friends | |
class | Socket |
Encapsulates the EPoll interface.
Applications need to provide an epoll object for each thread in the application that uses sockets. These threads then call EPoll.poll(100)
at regular intervals to check for and respond to network events.
Appropriate events are added/remove from the epoll event list when a tcp::Socket is created/destroyed. See the protected tcp::Socket.setEvents() method if you need to change which events a socket listens to.
When incoming events are recieved, they are automatically dispatched to the virtual Socket.handleEvents() method.
Definition at line 72 of file tcpsocket.h.
void tcp::EPoll::poll | ( | int | timeout | ) |
Call poll() regularly to respond to network events.
timeout | Number of ms to wait for an event. Can be zero. |
Definition at line 74 of file tcpsocket.cpp.