From 7be7f59d5caf38ca0cd7a12a937a2cfdca0268d7 Mon Sep 17 00:00:00 2001 From: hozan23 Date: Thu, 23 May 2024 00:21:59 +0200 Subject: p2p: add rpc server to monitor example --- net/src/stream/websocket.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'net/src/stream') diff --git a/net/src/stream/websocket.rs b/net/src/stream/websocket.rs index 9d41626..2626d2f 100644 --- a/net/src/stream/websocket.rs +++ b/net/src/stream/websocket.rs @@ -47,7 +47,10 @@ where pub async fn recv(&mut self) -> Result { match self.inner.next().await { - Some(msg) => self.codec.decode(&msg?), + Some(msg) => match self.codec.decode(&msg?)? { + Some(m) => Ok(m), + None => todo!(), + }, None => Err(Error::IO(std::io::ErrorKind::ConnectionAborted.into())), } } -- cgit v1.2.3