Add the pieces for a watchdog for dangling plugins

Once we register our plugins here, we should be able to gracefully shut
down any plugins whose remote process got killed.
This commit is contained in:
Robbert van der Helm
2021-05-01 16:45:37 +02:00
parent 167784f93b
commit 0f2db64aeb
4 changed files with 194 additions and 9 deletions
+4
View File
@@ -34,3 +34,7 @@ void HostBridge::handle_win32_events() {
DispatchMessage(&msg);
}
}
void HostBridge::shutdown_if_dangling() {
// TODO: Implement
}
+13 -3
View File
@@ -24,9 +24,11 @@
#include "../utils.h"
/**
* The base for the Wine plugin host bridge interface for all plugin types. This
* only has to be able to handle Win32 and X11 events. Implementations of this
* will actually host a plugin and do all the function call forwarding.
* The base for the Wine plugin host bridge interfaces for all plugin types.
* This mostly concerns event handling, and some common setup like loggers and a
* watchdog timer to let us shut down the sockets when the native host has
* exited while the sockets are still alive. Implementations of this will
* actually host a plugin and do all the function call forwarding.
*/
class HostBridge {
protected:
@@ -86,6 +88,14 @@ class HostBridge {
*/
void handle_win32_events();
/**
* Used as part of the watchdog. This will check whether the remote host
* process this bridge is connected with is still active. If it is not, then
* we'll close the sockets, which will cause this process to exit
* gracefully.
*/
void shutdown_if_dangling();
/**
* The path to the .dll being loaded in the Wine plugin host.
*/