Add unix socket bearer implementation
This commit is contained in:
parent
bfc5ef786a
commit
ed89607ac6
4 changed files with 108 additions and 68 deletions
|
|
@ -1,4 +1,4 @@
|
|||
use std::{net::TcpListener, thread, time::Duration};
|
||||
use std::{net::TcpListener, os::unix::net::UnixListener, thread, time::Duration};
|
||||
|
||||
use pallas_multiplexer::Multiplexer;
|
||||
|
||||
|
|
@ -7,7 +7,8 @@ const PROTOCOLS: [u16; 2] = [0x8002u16, 0x8003u16];
|
|||
fn main() {
|
||||
env_logger::init();
|
||||
|
||||
let server = TcpListener::bind("0.0.0.0:3001").unwrap();
|
||||
//let server = TcpListener::bind("0.0.0.0:3001").unwrap();
|
||||
let server = UnixListener::bind("/tmp/pallas").unwrap();
|
||||
let (bearer, _) = server.accept().unwrap();
|
||||
|
||||
let mut muxer = Multiplexer::try_setup(bearer, &PROTOCOLS).unwrap();
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
use std::{net::TcpStream, thread, time::Duration};
|
||||
use std::{net::TcpStream, os::unix::net::UnixStream, thread, time::Duration};
|
||||
|
||||
use pallas_multiplexer::Multiplexer;
|
||||
|
||||
|
|
@ -7,7 +7,8 @@ const PROTOCOLS: [u16; 2] = [0x0002u16, 0x0003u16];
|
|||
fn main() {
|
||||
env_logger::init();
|
||||
|
||||
let bearer = TcpStream::connect("127.0.0.1:3001").unwrap();
|
||||
//let bearer = TcpStream::connect("127.0.0.1:3001").unwrap();
|
||||
let bearer = UnixStream::connect("/tmp/pallas").unwrap();
|
||||
let mut muxer = Multiplexer::try_setup(bearer, &PROTOCOLS).unwrap();
|
||||
|
||||
for protocol in PROTOCOLS {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue