Add universal way to shutdown sockets on Wine side

This commit is contained in:
Robbert van der Helm
2021-05-01 16:47:09 +02:00
parent 0f2db64aeb
commit d8ca4022d1
5 changed files with 24 additions and 0 deletions
+8
View File
@@ -102,6 +102,14 @@ class HostBridge {
const boost::filesystem::path plugin_path;
protected:
/**
* Used as part of the watchdog that shuts down a plugin when the remote
* native host process dies. This is used to prevent plugins from hanging
* indefinitely on a `recv()`. This function should just call
* `sockets.close()`.
*/
virtual void close_sockets() = 0;
/**
* The IO context used for event handling so that all events and window
* message handling can be performed from a single thread, even when hosting
+4
View File
@@ -425,6 +425,10 @@ void Vst2Bridge::handle_x11_events() {
}
}
void Vst2Bridge::close_sockets() {
sockets.close();
}
intptr_t Vst2Bridge::dispatch_wrapper(AEffect* plugin,
int opcode,
int index,
+4
View File
@@ -68,6 +68,10 @@ class Vst2Bridge : public HostBridge {
void handle_x11_events() override;
protected:
void close_sockets() override;
public:
/**
* Forward the host callback made by the plugin to the host and return the
* results.
+4
View File
@@ -1133,6 +1133,10 @@ void Vst3Bridge::handle_x11_events() {
}
}
void Vst3Bridge::close_sockets() {
sockets.close();
}
void Vst3Bridge::register_context_menu(Vst3ContextMenuProxyImpl& context_menu) {
std::lock_guard lock(object_instances[context_menu.owner_instance_id()]
.registered_context_menus_mutex);
+4
View File
@@ -233,6 +233,10 @@ class Vst3Bridge : public HostBridge {
void handle_x11_events() override;
protected:
void close_sockets() override;
public:
/**
* Send a callback message to the host return the response. This is a
* shorthand for `sockets.vst_host_callback.send_message` for use in VST3