Less debug messages.
This commit is contained in:
parent
663f3766b1
commit
949184d708
1 changed files with 2 additions and 4 deletions
|
@ -127,8 +127,6 @@ fn broadcast(
|
||||||
fn remove_old_clients(socket: &UdpSocket, subscribers: &mut HashMap<String, DateTime<Local>>) {
|
fn remove_old_clients(socket: &UdpSocket, subscribers: &mut HashMap<String, DateTime<Local>>) {
|
||||||
let timestamp = Local::now();
|
let timestamp = Local::now();
|
||||||
|
|
||||||
//debug!("Number of clients: {}", subscribers.len());
|
|
||||||
|
|
||||||
for cl in &*subscribers {
|
for cl in &*subscribers {
|
||||||
if *cl.1 + Duration::seconds(CLIENT_TIMEOUT as i64) < timestamp {
|
if *cl.1 + Duration::seconds(CLIENT_TIMEOUT as i64) < timestamp {
|
||||||
debug!("Removing old client {}", cl.0);
|
debug!("Removing old client {}", cl.0);
|
||||||
|
@ -166,7 +164,7 @@ fn main() -> std::io::Result<()> {
|
||||||
remove_old_clients(&socket, &mut subscribers);
|
remove_old_clients(&socket, &mut subscribers);
|
||||||
|
|
||||||
for rec in &subscribers {
|
for rec in &subscribers {
|
||||||
debug!("Sending keepalive packet to {}", rec.0);
|
// debug!("Sending keepalive packet to {}", rec.0);
|
||||||
socket.send_to(b"", rec.0).unwrap();
|
socket.send_to(b"", rec.0).unwrap();
|
||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
|
@ -202,8 +200,8 @@ fn main() -> std::io::Result<()> {
|
||||||
subscribers.insert(client_addr.to_owned(), Local::now());
|
subscribers.insert(client_addr.to_owned(), Local::now());
|
||||||
}
|
}
|
||||||
} else if strip_header(data) == strip_header(mopp(speed, b"hi").as_slice()) {
|
} else if strip_header(data) == strip_header(mopp(speed, b"hi").as_slice()) {
|
||||||
debug!("Adding new client {client_addr}");
|
|
||||||
if subscribers.len() < MAX_CLIENTS {
|
if subscribers.len() < MAX_CLIENTS {
|
||||||
|
debug!("Adding new client {client_addr}");
|
||||||
subscribers.insert(client_addr.to_owned(), Local::now());
|
subscribers.insert(client_addr.to_owned(), Local::now());
|
||||||
socket
|
socket
|
||||||
.send_to(
|
.send_to(
|
||||||
|
|
Loading…
Reference in a new issue