ENUt
Public Member Functions

nut::SocketWaiter Class Reference

Allows you to wait for data to arrive on one or more sockets. More...

#include <socketwaiter.h>

List of all members.

Public Member Functions

void addSocket (Socket &s)
 Adds a socket to the list of sockets which should be monitored.
void removeSocket (Socket &s)
 Remove a socket from the list of sockets which should be monitored.
void clear ()
 Clears the list of sockets which should be monitored.
bool wait (int seconds=-1, int microSeconds=-1)
 Waits for data to become available on the sockets which are being monitored.

Detailed Description

Allows you to wait for data to arrive on one or more sockets. This is basically a wrapper class for using the 'select' function.


Member Function Documentation

void nut::SocketWaiter::addSocket ( Socket s) [inline]
void nut::SocketWaiter::clear ( ) [inline]
void nut::SocketWaiter::removeSocket ( Socket s) [inline]
bool nut::SocketWaiter::wait ( int  seconds = -1,
int  microSeconds = -1 
)

Waits for data to become available on the sockets which are being monitored. If one of the sockets has available data (or an incoming connection), the corresponding Socket::isDataAvailable function will then return true. The maximum amount of time to wait is specified by seconds and microSeconds.


The documentation for this class was generated from the following file: