Class CWatchDog#
Defined in File watchdog.h
Inheritance Relationships#
Base Types#
public sdv::IInterfaceAccess
(Struct IInterfaceAccess)public sdv::process::IProcessLifetimeCallback
(Struct IProcessLifetimeCallback)
Class Documentation#
-
class CWatchDog : public sdv::IInterfaceAccess, public sdv::process::IProcessLifetimeCallback#
The watch dog monitors the processes and connections.
The watch dog keeps track of the processes and disconnects when the process the connection is with doesn’t exist any more. This method is has advantages to using time-outs. If a process is being debugged and a breakpoint is triggered, all threads within the process are paused, which could cause a timeout by the calling process waiting for an answer. By monitoring the process existence, a pause doesn’t cause any error. If the process crashes, it is being removed by the OS, causing the monitor to detect this and the connection being terminated. Disadvantage is, that if the process is in a deadlock, this cannot be detected by this method.
Public Functions
-
CWatchDog()#
Constructor.
-
~CWatchDog()#
Destructor.
-
void Clear()#
Unregister all remaining monitors.
Add a connection object used for monitoring.
- Parameters:
rptrConnection – [in] Reference to the connection shared pointer.
-
void RemoveConnection(CConnection *pConnection, bool bAsync)#
Remove a connection.
- Parameters:
pConnection – [in] The connection pointer to remove the monitor for.
bAsync – [in] Use asnyhronous removal (use when the removal was triggered by a thread owned by the connection).
-
void AddMonitor(sdv::process::TProcessID tProcessID, CConnection *pConnection)#
Add a process monitor with the connection object to information.
- Parameters:
tProcessID – [in] Process ID of the process to monitor.
pConnection – [in] Pointer to the connection to inform when the process is killed.
-
void RemoveMonitor(const CConnection *pConnection)#
Remove a monitor.
- Parameters:
pConnection – [in] The connection pointer to remove the monitor for.
-
CWatchDog()#