This commit is contained in:
2026-08-12 09:08:01 -04:00
parent 9cc2014e55
commit fbf8dfc659
2 changed files with 19 additions and 1 deletions
+15 -1
View File
@@ -64,9 +64,23 @@ impl super::Client {
.await?;
}
let Some(ServerMethod::Meta(meta)) = Client::read_socket(&mut socket).await? else {
Client::send_socket(
&mut socket,
ClientMethod::Error {
error: Cow::Borrowed("Expected meta"),
},
)
.await?;
return Err(anyhow::anyhow!(
"Expected meta, client called another method"
));
};
Ok(Self {
socket,
meta: super::ClientMeta {},
meta,
public_key,
})
}
+4
View File
@@ -48,6 +48,8 @@ pub enum ServerMethod {
hostname: String,
},
Meta(ClientMeta),
Error {
error: String,
},
@@ -64,6 +66,8 @@ impl Client {
.await?;
}
ServerMethod::Meta(meta) => {}
ServerMethod::Error { error } => {
eprintln!("Client error: {error}");
}