add more log output
This commit is contained in:
parent
409fd741dd
commit
6f60423c03
2 changed files with 2 additions and 2 deletions
|
@ -32,7 +32,7 @@ func SendPermanentBroadCastMessage() {
|
||||||
// Remove unresponsive client
|
// Remove unresponsive client
|
||||||
client.Conn.Close()
|
client.Conn.Close()
|
||||||
delete(Clients, client.Conn.LocalAddr())
|
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
|
<-tick.C
|
||||||
|
|
|
@ -25,7 +25,7 @@ type WebsocketClient struct {
|
||||||
// Sends a message to the websocket.
|
// Sends a message to the websocket.
|
||||||
// Automatically locks and unlocks the client mutex, to ensure that only one goroutine can write at a time.
|
// 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 {
|
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()
|
c.LastPong = time.Now()
|
||||||
return nil
|
return nil
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in a new issue