Added documentation for SocketSelector.
This commit is contained in:
parent
b581418f2e
commit
a9493fca2a
@ -16,9 +16,37 @@ namespace fr
|
|||||||
public:
|
public:
|
||||||
SocketSelector() noexcept;
|
SocketSelector() noexcept;
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* Waits for a socket to become ready.
|
||||||
|
*
|
||||||
|
* @return True if a socket is ready. False if it timed out.
|
||||||
|
*/
|
||||||
bool wait();
|
bool wait();
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* Adds a socket to the selector. Note that SocketSelector
|
||||||
|
* does not keep a copy of the object, just a handle, it's
|
||||||
|
* up to you to store your fr::Sockets.
|
||||||
|
*
|
||||||
|
* @param socket The socket to add.
|
||||||
|
*/
|
||||||
void add(const Socket &socket);
|
void add(const Socket &socket);
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* Checks to see if a socket inside of the selector is ready.
|
||||||
|
* This should be called after 'wait' returns true, on
|
||||||
|
* each of the added sockets to see which one has received data.
|
||||||
|
*
|
||||||
|
* @param socket The socket to check if it's ready
|
||||||
|
* @return True if this socket is ready, false otherwise.
|
||||||
|
*/
|
||||||
bool is_ready(const Socket &socket);
|
bool is_ready(const Socket &socket);
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* Removes a socket from the socket selector.
|
||||||
|
*
|
||||||
|
* @param socket The socket to remove.
|
||||||
|
*/
|
||||||
void remove(const Socket &socket);
|
void remove(const Socket &socket);
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user