aboutsummaryrefslogtreecommitdiff
path: root/net/src/stream
diff options
context:
space:
mode:
authorhozan23 <hozan23@karyontech.net>2024-05-23 00:21:59 +0200
committerhozan23 <hozan23@karyontech.net>2024-05-23 00:21:59 +0200
commit7be7f59d5caf38ca0cd7a12a937a2cfdca0268d7 (patch)
treee45a49f8ccbf099a4618e5e3fe981a5b1bf9c421 /net/src/stream
parent2d1a8aea0b9330cd2eaad26eb187644adad6bed9 (diff)
p2p: add rpc server to monitor example
Diffstat (limited to 'net/src/stream')
-rw-r--r--net/src/stream/websocket.rs5
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())),
}
}