remove client from list if stale

This commit is contained in:
Sebastian Mark 2024-11-20 22:01:56 +01:00
parent 84b9e0afd6
commit b4eff894b8

View file

@ -14,6 +14,7 @@ func RemoveStaleClients() {
for _, client := range Clients { for _, client := range Clients {
if client.IsStale() { if client.IsStale() {
client.Conn.Close() client.Conn.Close()
delete(Clients, client.Conn.LocalAddr())
} }
} }
mu.Unlock() mu.Unlock()