add heartbeat on client side

montage-api
Moe 2022-01-20 13:01:15 -08:00
parent 19eb9cb172
commit 8740f39cc6
1 changed files with 3 additions and 0 deletions

View File

@ -25,6 +25,9 @@ $(document).ready(function(){
console.log('Sending Data',data)
return mainSocket.emit('f',data)
}
mainSocket.on('ping', function(){
mainSocket.emit('pong',{beat:1})
})
mainSocket.on('connect',function (d){
console.log('Connected to Websocket!')
if(location.search === '?p2p=1'){