add more log output

This commit is contained in:
Sebastian Mark 2024-11-20 20:21:22 +01:00
parent 409fd741dd
commit 6f60423c03
2 changed files with 2 additions and 2 deletions

View file

@ -32,7 +32,7 @@ func SendPermanentBroadCastMessage() {
// Remove unresponsive client
client.Conn.Close()
delete(Clients, client.Conn.LocalAddr())
helper.Logger.Info("Client timed out", "host", client.RealIP, "clients", len(Clients))
helper.Logger.Info("Client timed out", "lastPong", client.LastPong, "host", client.RealIP, "clients", len(Clients))
}
}
<-tick.C

View file

@ -25,7 +25,7 @@ type WebsocketClient struct {
// Sends a message to the websocket.
// Automatically locks and unlocks the client mutex, to ensure that only one goroutine can write at a time.
func (c *WebsocketClient) SendMessage(messageType int, data []byte) error {
c.Conn.SetPongHandler(func(appData string) error {
c.Conn.SetPongHandler(func(s string) error {
c.LastPong = time.Now()
return nil
})