File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed
Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -81,6 +81,7 @@ export class WebSocketAdapter extends EventEmitter implements IWebSocketAdapter
8181 . on ( 'message' , this . onClientMessage . bind ( this ) )
8282 . on ( 'close' , this . onClientClose . bind ( this ) )
8383 . on ( 'pong' , this . onClientPong . bind ( this ) )
84+ . on ( 'ping' , this . onClientPing . bind ( this ) )
8485
8586 this
8687 . on ( WebSocketAdapterEvent . Heartbeat , this . onHeartbeat . bind ( this ) )
@@ -258,6 +259,12 @@ export class WebSocketAdapter extends EventEmitter implements IWebSocketAdapter
258259 this . alive = true
259260 }
260261
262+ private onClientPing ( data : any ) {
263+ debugHeartbeat ( 'client %s ping' , this . clientId )
264+ this . client . pong ( data )
265+ this . alive = true
266+ }
267+
261268 private onClientClose ( ) {
262269 this . alive = false
263270 this . subscriptions . clear ( )
You can’t perform that action at this time.
0 commit comments