From a9493fca2a18e4684bba2e5001d34a191cf369bf Mon Sep 17 00:00:00 2001 From: Fred Nicolson Date: Sat, 10 Dec 2016 10:34:30 +0000 Subject: [PATCH] Added documentation for SocketSelector. --- include/SocketSelector.h | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/include/SocketSelector.h b/include/SocketSelector.h index 16ef23e..7a9fe7c 100644 --- a/include/SocketSelector.h +++ b/include/SocketSelector.h @@ -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: