diff --git a/internal/websocket/broadcast.go b/internal/websocket/broadcast.go index c4ed27a..c2bd987 100644 --- a/internal/websocket/broadcast.go +++ b/internal/websocket/broadcast.go @@ -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 diff --git a/pkg/models/client.go b/pkg/models/client.go index a4223a0..a758e77 100644 --- a/pkg/models/client.go +++ b/pkg/models/client.go @@ -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 })