eq::net::ConnectionSet Class Reference

A set of connections. More...

#include <connectionSet.h>

Inheritance diagram for eq::net::ConnectionSet:

Inheritance graph
[legend]
Collaboration diagram for eq::net::ConnectionSet:

Collaboration graph
[legend]

List of all members.

Public Types

enum  Event {
  EVENT_NONE = 0, EVENT_CONNECT, EVENT_DISCONNECT, EVENT_DATA,
  EVENT_TIMEOUT, EVENT_INTERRUPT, EVENT_ERROR, EVENT_SELECT_ERROR,
  EVENT_INVALID_HANDLE, EVENT_ALL
}

Public Member Functions

void addConnection (ConnectionPtr connection)
bool removeConnection (ConnectionPtr connection)
void clear ()
size_t size () const
bool empty () const
const ConnectionVectorgetConnections () const
Event select (const int timeout=-1)
 Selects a Connection which is ready for I/O.
void interrupt ()
 Interrupt the current or next select call.
int getError ()
ConnectionPtr getConnection ()


Detailed Description

A set of connections.

From the set, a connection with pending events can be selected.

Definition at line 44 of file connectionSet.h.


Member Enumeration Documentation

Enumerator:
EVENT_NONE  No event has occurred.
EVENT_CONNECT  A new connection.
EVENT_DISCONNECT  A disconnect.
EVENT_DATA  Data can be read.
EVENT_TIMEOUT  The selection request timed out.
EVENT_INTERRUPT  ConnectionSet::interrupt was called.
EVENT_ERROR  A connection signaled an error.
EVENT_SELECT_ERROR  An error occurred during select().
EVENT_INVALID_HANDLE  A connection is not select'able.

Definition at line 47 of file connectionSet.h.


Member Function Documentation

ConnectionSet::Event eq::net::ConnectionSet::select ( const int  timeout = -1  ) 

Selects a Connection which is ready for I/O.

Depending on the event, the error number and connection are set.

Parameters:
timeout the timeout to wait for an event in milliseconds, or -1 if the call should block indefinitly.
Returns:
The event occured during selection.

Definition at line 145 of file connectionSet.cpp.

References EQERROR, EQVERB, EVENT_CONNECT, EVENT_DATA, EVENT_INVALID_HANDLE, EVENT_NONE, EVENT_SELECT_ERROR, EVENT_TIMEOUT, eq::base::Buffer< T >::getData(), and eq::base::Buffer< T >::getSize().

Here is the call graph for this function:


The documentation for this class was generated from the following files:
Generated on Mon Aug 10 18:58:44 2009 for Equalizer 0.9 by  doxygen 1.5.8