A set of connections. More...
#include <connectionSet.h>


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 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 () |
A set of connections.
From the set, a connection with pending events can be selected.
Definition at line 54 of file connectionSet.h.
| 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.
| 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.
| timeout | the timeout to wait for an event in milliseconds, or -1 if the call should block indefinitly. |
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().

0.9.1 by
1.6.1