diff options
author | hozan23 <hozan23@karyontech.net> | 2024-05-23 00:21:59 +0200 |
---|---|---|
committer | hozan23 <hozan23@karyontech.net> | 2024-05-23 00:21:59 +0200 |
commit | 7be7f59d5caf38ca0cd7a12a937a2cfdca0268d7 (patch) | |
tree | e45a49f8ccbf099a4618e5e3fe981a5b1bf9c421 /net/src/stream | |
parent | 2d1a8aea0b9330cd2eaad26eb187644adad6bed9 (diff) |
p2p: add rpc server to monitor example
Diffstat (limited to 'net/src/stream')
-rw-r--r-- | net/src/stream/websocket.rs | 5 |
1 files changed, 4 insertions, 1 deletions
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<C::Item> { 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())), } } |