|
|
|
@ -143,7 +143,6 @@ func (c *Connection) readPump() { |
|
|
|
c.ws.SetReadLimit(maxMessageSize) |
|
|
|
c.ws.SetReadLimit(maxMessageSize) |
|
|
|
c.ws.SetReadDeadline(time.Now().Add(pongWait)) |
|
|
|
c.ws.SetReadDeadline(time.Now().Add(pongWait)) |
|
|
|
c.ws.SetPongHandler(func(string) error { |
|
|
|
c.ws.SetPongHandler(func(string) error { |
|
|
|
log.Println("Received pong", c.Idx) |
|
|
|
|
|
|
|
c.ws.SetReadDeadline(time.Now().Add(pongWait)) |
|
|
|
c.ws.SetReadDeadline(time.Now().Add(pongWait)) |
|
|
|
return nil |
|
|
|
return nil |
|
|
|
}) |
|
|
|
}) |
|
|
|
@ -270,10 +269,6 @@ func (c *Connection) writePump() { |
|
|
|
|
|
|
|
|
|
|
|
// Write ping message.
|
|
|
|
// Write ping message.
|
|
|
|
func (c *Connection) ping() error { |
|
|
|
func (c *Connection) ping() error { |
|
|
|
log.Println("Sending ping", c.Idx) |
|
|
|
|
|
|
|
defer func() { |
|
|
|
|
|
|
|
log.Println("Sent ping", c.Idx) |
|
|
|
|
|
|
|
}() |
|
|
|
|
|
|
|
return c.write(websocket.PingMessage, []byte{}) |
|
|
|
return c.write(websocket.PingMessage, []byte{}) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|