|
@ -38,7 +38,7 @@ export class WebSocketClient { |
|
|
const heartSend = () => { |
|
|
const heartSend = () => { |
|
|
// 开启状态直接发送
|
|
|
// 开启状态直接发送
|
|
|
if (socket.readyState === socket.OPEN) { |
|
|
if (socket.readyState === socket.OPEN) { |
|
|
socket.send(JSON.stringify({ type: 'ping' })) |
|
|
|
|
|
|
|
|
socket.send(JSON.stringify({ messageType: 'ping', messageld: Date.now().toString(), timestamp: Date.now() })) |
|
|
} |
|
|
} |
|
|
else { |
|
|
else { |
|
|
clearInterval(hearBeat_timer) |
|
|
clearInterval(hearBeat_timer) |
|
|