38 SOCK_POLLOUT:
"write",
39 SOCK_POLLIN | SOCK_POLLOUT:
"read and write",
47 hash<string, hash<PollInfo>>
cache;
223 *
bool processCommands();
241 AbstractConnection conn;
244 AbstractPollOperation spop;
246 # other data stored alongside the connection
250class RecursiveAutoLock {
258 constructor(Mutex m);
abstract base class for connections
Definition: AbstractConnection.qc.dox.h:34
Class for monitoring connection supporting the polling API.
Definition: PollingConnectionMonitor.qc.dox.h:32
bool removeConnection(string name)
Removes the given connection.
date ping_repeat
ping repeat duration
Definition: PollingConnectionMonitor.qc.dox.h:59
handlePingTimeout(string name, date delta)
Handles a poll timeout.
handlePingSuccess(string name, date delta, *bool oldok)
Handles a successful ping.
File sem_write
File to signal the I/O thread.
Definition: PollingConnectionMonitor.qc.dox.h:86
setAutostart(bool autostart=True)
Set autostart flag.
start()
Starts monitoring.
Mutex m()
Lock for atomic actions.
Queue cmdq()
I/O thread command queue.
handlePingFailed(string name, date delta, hash< ExceptionInfo > ex)
Handles a failed ping.
restartPing(string name, *bool force_restart)
Restarts a ping operation.
handlePingTimeoutIntern(string name, date delta)
Handles a ping timeout.
removeConnectionEx(string name)
Removes the given connection.
add(AbstractConnection conn, *hash< auto > other)
Adds a connection to be monitored.
const IO_REMOVE
I/O thread command: remove.
Definition: PollingConnectionMonitor.qc.dox.h:68
Counter mcnt()
I/O thread counter.
int tid
I/O thread TID.
Definition: PollingConnectionMonitor.qc.dox.h:50
addOrUpdate(AbstractConnection conn, *hash< auto > other)
Adds or updates an existing connection that is already being monitored.
destructor()
Stops the monitoring thread and destroys the object.
const IO_UPDATE
I/O thread command: update.
Definition: PollingConnectionMonitor.qc.dox.h:65
ReadOnlyFile sem_read
File to read in the I/O thread.
Definition: PollingConnectionMonitor.qc.dox.h:89
constructor(*LoggerInterface logger)
Creates the object.
const IO_ADD
I/O thread command: add.
Definition: PollingConnectionMonitor.qc.dox.h:62
bool autostart
Autostart monitoring thread with first connection.
Definition: PollingConnectionMonitor.qc.dox.h:53
stopClear()
Stops monitoring and clears all connections.
const IO_QUIT_REMOVE_ALL
I/O thread command: quit and remove all connection.
Definition: PollingConnectionMonitor.qc.dox.h:74
hash< SocketPollInfo > sem_info
Semaphore descriptor info.
Definition: PollingConnectionMonitor.qc.dox.h:92
const IO_QUIT
I/O thread command: quit.
Definition: PollingConnectionMonitor.qc.dox.h:71
bool getAutostart()
Get autostart flag.
hash< string, hash< PollInfo > > cache
Connection cache; unique name -> connection object wrapper.
Definition: PollingConnectionMonitor.qc.dox.h:47
date ping_timeout
ping timeout duration
Definition: PollingConnectionMonitor.qc.dox.h:56
const PollEventMap
Polling event map.
Definition: PollingConnectionMonitor.qc.dox.h:36
const DefaultPingTimeout
Default ping timeout duration.
Definition: PollingConnectionMonitor.qc.dox.h:77
const DefaultPingRepeat
Default ping repeat duration.
Definition: PollingConnectionMonitor.qc.dox.h:80
bool running()
Returns True if the I/O thread is running.
The ConnectionProvider namespace.
Definition: AbstractConnection.qc.dox.h:28