Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
bettercalljason committed Jan 10, 2025
1 parent 877d892 commit 982ad4f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion server/src/handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use tracing::{info, warn};

pub struct BrokerConfig {
pub max_qos: QoS,
pub keep_alive: u16, // Set it to the Transport's max idle timeout: https://github.com/quinn-rs/quinn/blob/f5b1ec7dd96c9b56ef98f2a7a91acaf5e341d718/quinn-proto/src/config/transport.rs#L331
pub keep_alive: u16,
}

pub struct PacketHandler;
Expand Down
2 changes: 1 addition & 1 deletion server/src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ pub async fn run_server(config: ServerConfig) -> Result<()> {

let config2 = Arc::new(BrokerConfig {
max_qos: QoS::AtMostOnce,
keep_alive: 10, // typically, this is a few minutes. server should close if no packet received within 1.5 times of this time MQTT-3.1.2-22
keep_alive: 10,
});

while let Some(conn) = endpoint.accept().await {
Expand Down

0 comments on commit 982ad4f

Please sign in to comment.