Fix bytes

This commit is contained in:
Bastian Gruber 2023-04-24 23:49:24 +02:00
parent f4eb7213ab
commit d84b683dd9
No known key found for this signature in database
GPG key ID: BE9F8C772B188CBF

View file

@ -64,11 +64,11 @@ impl Connection {
pub async fn write_frame(&mut self, frame: &Frame) -> tokio::io::Result<()> {
debug!(?frame);
if let Frame::Response(mean) = frame {
let res = self.stream.write(&mean.to_ne_bytes()).await?;
let res = self.stream.write(&[mean.to_ne_bytes()[0]]).await?;
info!("Write frame Response to stream");
return self.stream.flush().await;
}
Err("Wrong frame".into())
Ok(())
}
}