mirror of
https://github.com/m1k1o/neko.git
synced 2025-07-31 15:29:41 +02:00
send heartbeat with ping. (#16)
This commit is contained in:
parent
482476489e
commit
2cb64d15a0
4 changed files with 21 additions and 2 deletions
|
@ -75,6 +75,13 @@ func (peer *WebSocketPeerCtx) Ping() error {
|
|||
return errors.New("peer connection not found")
|
||||
}
|
||||
|
||||
// application level heartbeat
|
||||
if err := peer.connection.WriteJSON(types.WebSocketMessage{
|
||||
Event: event.SYSTEM_HEARTBEAT,
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return peer.connection.WriteMessage(websocket.PingMessage, nil)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue