aboutsummaryrefslogtreecommitdiff
path: root/src/peering/fullmesh.rs
diff options
context:
space:
mode:
authortrinity-1686a <trinity@deuxfleurs.fr>2022-06-08 00:30:56 +0200
committertrinity-1686a <trinity@deuxfleurs.fr>2022-06-08 09:54:38 +0200
commit4745e7c4ba5665d3303ae567087781778cec9c34 (patch)
tree667effc91ab5674360ef0211ab32b533a35f36af /src/peering/fullmesh.rs
parentfb5462ecdb6b5731a63a902519d3ec9b1061b8dd (diff)
downloadnetapp-4745e7c4ba5665d3303ae567087781778cec9c34.tar.gz
netapp-4745e7c4ba5665d3303ae567087781778cec9c34.zip
further work on streams
most changes still required are related to error handling
Diffstat (limited to 'src/peering/fullmesh.rs')
-rw-r--r--src/peering/fullmesh.rs8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/peering/fullmesh.rs b/src/peering/fullmesh.rs
index 012c5a0..7dfc5c4 100644
--- a/src/peering/fullmesh.rs
+++ b/src/peering/fullmesh.rs
@@ -29,7 +29,7 @@ const FAILED_PING_THRESHOLD: usize = 3;
// -- Protocol messages --
-#[derive(Serialize, Deserialize)]
+#[derive(Serialize, Deserialize, Clone)]
struct PingMessage {
pub id: u64,
pub peer_list_hash: hash::Digest,
@@ -39,7 +39,9 @@ impl Message for PingMessage {
type Response = PingMessage;
}
-#[derive(Serialize, Deserialize)]
+impl AutoSerialize for PingMessage {}
+
+#[derive(Serialize, Deserialize, Clone)]
struct PeerListMessage {
pub list: Vec<(NodeID, SocketAddr)>,
}
@@ -48,6 +50,8 @@ impl Message for PeerListMessage {
type Response = PeerListMessage;
}
+impl AutoSerialize for PeerListMessage {}
+
// -- Algorithm data structures --
#[derive(Debug)]