Closed
Description
Expected behaviour:
loop
connected
loop
Actual behaviour:
loop
server.rs
use async_std::prelude::*;
use async_std::os::unix::net::UnixListener;
use async_std::task;
async fn run() {
let socket = UnixListener::bind("/tmp/test.sock").await.expect("bind");
let mut incoming = socket.incoming();
loop {
println!("loop");
if let Some(stream) = incoming.next().await {
println!("connected");
}
}
}
fn main() {
task::block_on(run());
}
client.rs
use async_std::task;
use async_std::prelude::*;
use async_std::os::unix::net::UnixStream;
async fn run() {
let mut socket = UnixStream::connect("/tmp/test.sock").await.expect("connect");
socket.write_all(b"hello world").await.expect("write");
socket.flush().await.expect("flush");
}
fn main() {
task::block_on(run());
}