Adding runner handshake

This commit is contained in:
Sebastian authored and Hakan Seven committed 2026-06-28 10:41:01 +03:00
1 parent d209e7bbb5
commit 04240862e1
5 files changed
+114 -4

No files matched your search

+9 -1
View File
@@ -13,7 +13,7 @@ use interprocess::local_socket::{GenericNamespaced, Stream, ToNsName};
use crate::host::{DocumentReader, HostApi, InteractiveCommand, ReaderEntity};
use crate::ipc::protocol::{
HostResponse, HostToPlugin, PluginRequest, PluginResponse, PluginToHost,
HostResponse, HostToPlugin, PluginRequest, PluginResponse, PluginToHost, RunnerHandshake,
};
use crate::ipc::transport::{recv, send};
use crate::shm::{DocumentViewInfo, SharedDocumentReader};
@@ -46,6 +46,14 @@ impl IpcClient {
self.stream.borrow_mut()
}
/// Send the initial runner handshake presenting the pre-shared token.
pub fn send_handshake(&self, token: &str) -> Result<(), crate::ipc::transport::TransportError> {
send(
&mut self.stream.borrow_mut(),
&RunnerHandshake::Token(token.to_string()),
)
}
/// Send a plugin request and wait for the matching response. Any nested
/// host requests that arrive while we are waiting are treated as errors.
pub fn request(