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.

Classes

union  Result

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 getSize () const
bool isEmpty () 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 54 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 57 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 275 of file connectionSet.cpp.

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

Here is the call graph for this function:


The documentation for this class was generated from the following files:
Generated on Sat Feb 6 13:08:55 2010 for Equalizer 0.9.1 by  doxygen 1.6.1