We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 06ed371 commit 310fbc2Copy full SHA for 310fbc2
src/server/client.rs
@@ -73,7 +73,7 @@ impl<S> Client<S> {
73
74
// Send the length first as network endian.
75
self.stream
76
- .write_all(length.to_ne_bytes().as_slice())
+ .write_all(length.to_be_bytes().as_slice())
77
.await?;
78
79
// Send the actual message next.
@@ -101,7 +101,7 @@ impl<S> Client<S> {
101
102
// Parse the length
103
let message_length: usize =
104
- MsgLength::from_ne_bytes(self.buf[..size_of::<MsgLength>()].try_into()?).try_into()?;
+ MsgLength::from_be_bytes(self.buf[..size_of::<MsgLength>()].try_into()?).try_into()?;
105
106
// Verify the length
107
if message_length == 0 {
0 commit comments