fix: use u16 for listen port end-to-end
Port numbers are 16-bit; the codebase had listen_port/listener_port typed as u32, inconsistent with PeerAddress.port (already u16). Migrate the type all the way through the CLI, config, ClientSettings, Client, ServerActor, and the listener entry point. The wire format is preserved: build_set_wait_port_message now takes u16 and widens to u32 via .into() before write_int32. Also rename DEFALT_LISTEN_PORT to DEFAULT_LISTEN_PORT.
This commit is contained in:
@@ -68,12 +68,10 @@ impl MessageFactory {
|
||||
pub fn build_no_parent_message() -> Message {
|
||||
Message::new().write_int32(71).write_bool(true).clone()
|
||||
}
|
||||
pub fn build_set_wait_port_message(port: u32) -> Message {
|
||||
pub fn build_set_wait_port_message(port: u16) -> Message {
|
||||
Message::new()
|
||||
.write_int32(2)
|
||||
.write_int32(port)
|
||||
// .write_int32(0)
|
||||
// .write_int32(port) // should be different port
|
||||
.write_int32(port.into())
|
||||
.clone()
|
||||
}
|
||||
pub fn build_watch_user(token: u32) -> Message {
|
||||
|
||||
Reference in New Issue
Block a user