From 0a64871c9cf855082cc469bbab779ce293ea4bb6 Mon Sep 17 00:00:00 2001 From: Matt Johnston <matt@ucc.asn.au> Date: Sun, 21 Aug 2022 11:32:43 +0800 Subject: [PATCH] Fix listener, ignore progress result --- async/examples/serv1.rs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/async/examples/serv1.rs b/async/examples/serv1.rs index b94553f..031e822 100644 --- a/async/examples/serv1.rs +++ b/async/examples/serv1.rs @@ -170,11 +170,7 @@ fn run_session<'a, R: Send>(args: &'a Args, scope: &'a moro::Scope<'a, '_, R>, m loop { let ev = serv.progress(&mut app, |ev| { trace!("progress event {ev:?}"); - let e = match ev { - Event::CliAuthed => Some(Event::CliAuthed), - _ => None, - }; - Ok(e) + Ok(Some(())) }).await.context("progress loop")?; } #[allow(unreachable_code)] @@ -188,7 +184,8 @@ fn run_session<'a, R: Send>(args: &'a Args, scope: &'a moro::Scope<'a, '_, R>, m } async fn run(args: &Args) -> Result<()> { - let listener = TcpListener::bind(("", args.port)).await?; + // TODO not localhost. also ipv6? + let listener = TcpListener::bind(("localhost", args.port)).await.context("Listening")?; moro::async_scope!(|scope| { scope.spawn(async { loop { -- GitLab