mirror of
https://github.com/scsibug/nostr-rs-relay.git
synced 2024-11-22 09:09:07 -05:00
feat: add log for unique client connection count
This commit is contained in:
parent
531f6c4624
commit
6910b8d945
|
@ -58,6 +58,8 @@ fn main() -> Result<(), Error> {
|
||||||
info!("shutting down due to SIGINT");
|
info!("shutting down due to SIGINT");
|
||||||
ctrl_c_shutdown.send(()).ok();
|
ctrl_c_shutdown.send(()).ok();
|
||||||
});
|
});
|
||||||
|
// track unique client connection count
|
||||||
|
let mut client_accept_count: usize = 0;
|
||||||
let mut stop_listening = invoke_shutdown.subscribe();
|
let mut stop_listening = invoke_shutdown.subscribe();
|
||||||
// handle new client connection requests, or SIGINT signals.
|
// handle new client connection requests, or SIGINT signals.
|
||||||
loop {
|
loop {
|
||||||
|
@ -66,6 +68,8 @@ fn main() -> Result<(), Error> {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
Ok((stream, _)) = listener.accept() => {
|
Ok((stream, _)) = listener.accept() => {
|
||||||
|
client_accept_count += 1;
|
||||||
|
info!("creating new connection for client #{}",client_accept_count);
|
||||||
tokio::spawn(nostr_server(
|
tokio::spawn(nostr_server(
|
||||||
stream,
|
stream,
|
||||||
bcast_tx.clone(),
|
bcast_tx.clone(),
|
||||||
|
|
Loading…
Reference in New Issue
Block a user