Added documentation for SocketSelector.

This commit is contained in:
Fred Nicolson 2016-12-10 10:34:30 +00:00
parent b581418f2e
commit a9493fca2a

View File

@ -16,9 +16,37 @@ namespace fr
public:
SocketSelector() noexcept;
/*!
* Waits for a socket to become ready.
*
* @return True if a socket is ready. False if it timed out.
*/
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);
/*!
* 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);
/*!
* Removes a socket from the socket selector.
*
* @param socket The socket to remove.
*/
void remove(const Socket &socket);
private: