-
-
Notifications
You must be signed in to change notification settings - Fork 9
/
local.rs
41 lines (32 loc) · 871 Bytes
/
local.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/**
© 2020 - 2021 PERLUR Group
SPDX-License-Identifier: GPL-3.0-only OR LGPL-3.0-only
*/
use cardano_ouroboros_network::mux;
use futures::executor::block_on;
use log::info;
use std::env;
mod common;
/**
* Test a handshake with the local node's unix socket
*/
#[cfg(target_family = "unix")]
fn main() {
let cfg = common::init();
let args: Vec<String> = env::args().collect();
let magic = cfg.magic;
let socket_path = &args[1];
info!("UNIX socket path set to {} ", socket_path);
block_on(async {
let channel = mux::connection::connect_unix(socket_path)
.await
.unwrap();
channel.handshake(magic).await.unwrap();
info!("Ping UNIX socket success");
});
}
#[cfg(target_family = "windows")]
fn main() {
let cfg = common::init();
error!("This test is not available on Windows!");
}