eq::net::ConnectionSet Class Reference

#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.


Detailed Description

A set of connections.

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

Definition at line 33 of file connectionSet.h.


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 ConnectionVector & getConnections () 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 ()

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 36 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 125 of file connectionSet.cpp.

References eq::base::Buffer< T >::data, EVENT_CONNECT, EVENT_DATA, EVENT_INVALID_HANDLE, EVENT_NONE, EVENT_SELECT_ERROR, EVENT_TIMEOUT, and eq::base::Buffer< T >::size.


The documentation for this class was generated from the following files:
Generated on Sat Dec 6 12:01:51 2008 for Equalizer 0.6 by  doxygen 1.5.5