42 hash<string, hash<PollInfo>>
cache;
179 logArgs(
int lvl,
string msg,
auto args);
182 log(
int lvl,
string msg);
231 *
bool processCommands();
249 AbstractConnection conn;
252 AbstractPollOperation spop;
254 # other data stored alongside the connection
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:57
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:84
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:66
Counter mcnt()
I/O thread counter.
int tid
I/O thread TID.
Definition: PollingConnectionMonitor.qc.dox.h:45
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:63
ReadOnlyFile sem_read
File to read in the I/O thread.
Definition: PollingConnectionMonitor.qc.dox.h:87
*Logger logger
Logger.
Definition: PollingConnectionMonitor.qc.dox.h:48
const IO_ADD
I/O thread command: add.
Definition: PollingConnectionMonitor.qc.dox.h:60
bool autostart
Autostart monitoring thread with first connection.
Definition: PollingConnectionMonitor.qc.dox.h:51
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:72
hash< SocketPollInfo > sem_info
Semaphore descriptor info.
Definition: PollingConnectionMonitor.qc.dox.h:90
const IO_QUIT
I/O thread command: quit.
Definition: PollingConnectionMonitor.qc.dox.h:69
setLogger(Logger logger)
Sets the logger.
bool getAutostart()
Get autostart flag.
hash< string, hash< PollInfo > > cache
Connection cache; unique name -> connection object wrapper.
Definition: PollingConnectionMonitor.qc.dox.h:42
date ping_timeout
ping timeout duration
Definition: PollingConnectionMonitor.qc.dox.h:54
constructor(*Logger logger)
Creates the object.
const DefaultPingTimeout
Default ping timeout duration.
Definition: PollingConnectionMonitor.qc.dox.h:75
const DefaultPingRepeat
Default ping repeat duration.
Definition: PollingConnectionMonitor.qc.dox.h:78
bool running()
Returns True if the I/O thread is running.
The ConnectionProvider namespace.
Definition: AbstractConnection.qc.dox.h:28