mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 09:21:05 +00:00
Add IPC support (#6348)
This is useful for both security and performance reasons. IPC is faster than TCP, and it is subject to OS access controls.
This commit is contained in:
@@ -510,6 +510,16 @@ mod waiting {
|
||||
}
|
||||
}
|
||||
|
||||
pub struct IpcServer(pub Option<sc_rpc_server::IpcServer>);
|
||||
impl Drop for IpcServer {
|
||||
fn drop(&mut self) {
|
||||
if let Some(server) = self.0.take() {
|
||||
server.close_handle().close();
|
||||
let _ = server.wait();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub struct WsServer(pub Option<sc_rpc_server::WsServer>);
|
||||
impl Drop for WsServer {
|
||||
fn drop(&mut self) {
|
||||
@@ -555,6 +565,7 @@ fn start_rpc_servers<H: FnMut(sc_rpc::DenyUnsafe) -> sc_rpc_server::RpcHandler<s
|
||||
}
|
||||
|
||||
Ok(Box::new((
|
||||
config.rpc_ipc.as_ref().map(|path| sc_rpc_server::start_ipc(&*path, gen_handler(sc_rpc::DenyUnsafe::No))),
|
||||
maybe_start_server(
|
||||
config.rpc_http,
|
||||
|address| sc_rpc_server::start_http(
|
||||
|
||||
Reference in New Issue
Block a user