diff --git a/crates/shared/src/pipe.rs b/crates/shared/src/pipe.rs index 3f8ca1d..54f52e9 100644 --- a/crates/shared/src/pipe.rs +++ b/crates/shared/src/pipe.rs @@ -75,7 +75,7 @@ impl Client { let data_len = buf.len() - size_of::(); // // ^---^ <-- copy len to here - buf[..size_of::()].copy_from_slice(&data_len.to_le_bytes()); + buf[..size_of::()].copy_from_slice(&data_len.to_be_bytes()); let fut = async { let size = buf.len(); @@ -278,7 +278,7 @@ impl Server { // // ^---^ if self.msg_len.is_none() && self.buf.len() >= size_of::() { - self.msg_len = Some(usize::from_le_bytes( + self.msg_len = Some(usize::from_be_bytes( self.buf[..size_of::()].try_into().unwrap(), ));