![]() |
Gamedev Framework (gf) 1.2.0
A C++17 framework for 2D games
|
A socket selector. More...
#include <gf/SocketSelector.h>
Public Member Functions | |
SocketSelector () | |
Constructor. More... | |
void | addSocket (Socket &socket) |
Add a socket to the selector. More... | |
void | removeSocket (Socket &socket) |
Remove a socket from the selector. More... | |
void | clear () |
Clear all the sockets in the selector. More... | |
SocketSelectorStatus | wait (Time duration=seconds(-1)) |
Wait for an event of the set of sockets. More... | |
bool | isReady (Socket &socket) |
Tell if the provided socket is ready. More... | |
A socket selector.
gf::SocketSelector::SocketSelector | ( | ) |
Constructor.
void gf::SocketSelector::addSocket | ( | Socket & | socket | ) |
Add a socket to the selector.
void gf::SocketSelector::clear | ( | ) |
Clear all the sockets in the selector.
bool gf::SocketSelector::isReady | ( | Socket & | socket | ) |
Tell if the provided socket is ready.
void gf::SocketSelector::removeSocket | ( | Socket & | socket | ) |
Remove a socket from the selector.
SocketSelectorStatus gf::SocketSelector::wait | ( | Time | duration = seconds(-1) | ) |
Wait for an event of the set of sockets.
A duration for a timeout can be provided. In this case, if the duration is negative, it indicates an infinite timeout. If the duration is zero, the call will return immediately. Otherwise, the timeout can occur after the provided duration if no event occurred.
duration | The duration for the timeout |