Fix Message Serialisation
All checks were successful
Build and Test / nncs (push) Successful in 1m30s
All checks were successful
Build and Test / nncs (push) Successful in 1m30s
This commit is contained in:
parent
73526c08c4
commit
9b08b8e961
1 changed files with 2 additions and 1 deletions
|
|
@ -41,7 +41,8 @@ impl Message {
|
|||
let mut bytes = [0u8; 16];
|
||||
|
||||
bytes[0..4].copy_from_slice(&self.r#type.to_be_bytes());
|
||||
bytes[4..8].copy_from_slice(&remote_addr.port().to_be_bytes());
|
||||
let port = remote_addr.port() as u32;
|
||||
bytes[4..8].copy_from_slice(&port.to_be_bytes());
|
||||
bytes[8..12].copy_from_slice(&u32::from(*remote_addr.ip()).to_be_bytes());
|
||||
let local_ip = match socket.local_addr().unwrap() {
|
||||
SocketAddr::V4(addr) => *addr.ip(),
|
||||
|
|
|
|||
Loading…
Reference in a new issue