example/rpc: Add unix listeners.

This commit is contained in:
parazyd
2023-08-18 10:07:37 +02:00
parent 52599c947b
commit 9103045723
2 changed files with 4 additions and 2 deletions

View File

@@ -26,7 +26,8 @@ use darkfi::{
};
async fn realmain(ex: Arc<Executor<'_>>) -> Result<()> {
let endpoint = Url::parse("tcp://127.0.0.1:55422").unwrap();
//let endpoint = Url::parse("tcp://127.0.0.1:55422").unwrap();
let endpoint = Url::parse("unix:///tmp/rpc.sock").unwrap();
let client = RpcClient::new(endpoint, Some(ex)).await?;

View File

@@ -66,7 +66,8 @@ impl RequestHandler for RpcSrv {
async fn realmain(ex: Arc<Executor<'_>>) -> Result<()> {
let rpcsrv = Arc::new(RpcSrv { stop_sub: smol::channel::unbounded::<()>() });
let rpc_listen = Url::parse("tcp://127.0.0.1:55422").unwrap();
//let rpc_listen = Url::parse("tcp://127.0.0.1:55422").unwrap();
let rpc_listen = Url::parse("unix:///tmp/rpc.sock").unwrap();
let _ex = ex.clone();
ex.spawn(listen_and_serve(rpc_listen, rpcsrv.clone(), _ex)).detach();