#include <cabal_channel.h>
Inheritance diagram for Cabal::Channel:
Public Member Functions | |
Channel (const long bwidth=0) | |
void | addSocket (Socket *skt) |
Subscribe a socket. | |
void | removeSocket (Socket *skt) |
Unsuscribe a socket. | |
void | schedule (Connection *con, const Priority prio) |
Schedule a connection for immediate or deferred transmission. | |
void | deschedule (const Connection *con, const Priority prio, const bool complete=false) |
Cancels existing schedulation request. | |
void | deschedule (const Connection *con) |
Cancels existing schedulation requests on all the lists. | |
bool | process (MSECS msecs) |
Does a single processing loop, with a maximum given wait. |
This class provides callback network support.
Definition at line 38 of file cabal_channel.h.
|
Cancels existing schedulation requests on all the lists. To be sure... Definition at line 119 of file cabal_channel.h. References deschedule(). |
|
Cancels existing schedulation request. The priority list indicated with prio parameter is searched for the connection. If found, the connection is removed from the list. If complete is false (default), the function then stop scanning the list and returns, otherwise it continues removing other eventual scheduled references to con. Notice that having more than one scheduled instance of a connection should be considered a pathological condition, and generally a thing to avoid (by i.e. scheduling the connection only via its transmission). Definition at line 82 of file ltlib/cabal_channel.cpp. Referenced by deschedule(), and Cabal::Connection::~Connection(). |
|
Does a single processing loop, with a maximum given wait. All the subscribed sockets having transmissions due to transmit are listened for ready-to-send signal, and all the sockets having receptions are listened for incoming data. All the sockets having positive test are sent to the relative transmissions an dreceptions. If msecs expires before any positive output-due sockets are found writable and input-due socket are found readable, the function returns. If msecs is zero, the function doesn't wait; it just checks for sockets being immediately writeable or readable, and performs operations on that sockets. If msecs is -1 waits forever until at least one socket is read or written.
Definition at line 101 of file ltlib/cabal_channel.cpp. References Cabal::Socket::closed(), Cabal::Socket::decref(), Cabal::Connection::line(), Cabal::Socket::osError(), Cabal::Socket::rawSocket(), Cabal::Socket::reception(), Cabal::Line::remove(), Cabal::Connection::socket(), and Cabal::Connection::transmission(). |
|
Schedule a connection for immediate or deferred transmission. Notice that scheduling a connection does not sets an ownership relationship on the channel. The connections are owned by the Cabal::Line class, which is available for be integrated into application data. Connection (non virtual) destructor deschedule itself from the channel, making sure that the channel doesn't try to call the connection after destruction (except in case of multithreading race conditions that must be handled at application level).
Definition at line 58 of file ltlib/cabal_channel.cpp. References Cabal::Connection::nextSchedule(). Referenced by Cabal::Connection::schedule(). |