mirror of
https://github.com/hubaldv/bioz-host-rs.git
synced 2026-07-24 00:57:44 +00:00
Show TCP connected status.
Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
@@ -10,6 +10,7 @@ pub async fn tcp_command_server(app_control_tx: Sender<ControlCommand>) {
|
||||
|
||||
loop {
|
||||
let (socket, addr) = listener.accept().await.unwrap();
|
||||
app_control_tx.try_send(ControlCommand::TcpConnected(true)).unwrap();
|
||||
println!("Client connected: {:?}", addr);
|
||||
|
||||
let tx = app_control_tx.clone();
|
||||
@@ -42,6 +43,7 @@ pub async fn tcp_command_server(app_control_tx: Sender<ControlCommand>) {
|
||||
}
|
||||
|
||||
println!("Client disconnected: {:?}", addr);
|
||||
tx.try_send(ControlCommand::TcpConnected(false)).unwrap();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user