mirror of
https://seed.radicle.dev/rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5.git
synced 2026-11-21 10:30:41 +08:00
node: Implement Client
Signed-off-by: Alexis Sellier <self@cloudhead.io>
This commit is contained in:
@@ -129,11 +129,7 @@ where
|
||||
}
|
||||
|
||||
pub fn receive(&mut self, peer: &net::SocketAddr, msg: Message) {
|
||||
let bytes = serde_json::to_vec(&Envelope {
|
||||
magic: NETWORK_MAGIC,
|
||||
msg,
|
||||
})
|
||||
.unwrap();
|
||||
let bytes = serde_json::to_vec(&self.config().network.envelope(msg)).unwrap();
|
||||
|
||||
self.protocol.received_bytes(peer, &bytes);
|
||||
}
|
||||
@@ -212,7 +208,7 @@ where
|
||||
}
|
||||
|
||||
/// Get a draining iterator over the peers's I/O outbox.
|
||||
pub fn outbox(&mut self) -> impl Iterator<Item = Io<(), DisconnectReason>> + '_ {
|
||||
pub fn outbox(&mut self) -> impl Iterator<Item = Io<Event, DisconnectReason>> + '_ {
|
||||
self.protocol.outbox().drain(..)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user