java websocket心跳包_给websocket加入心跳包防止自动断开连接
reconnect(url) {if(lockReconnect) return;lockReconnect = true;setTimeout(function () { //没连接上会一直重连,设置延迟避免请求过多createWebSocket(url);lockReconnect = false;}, 2000);}//心跳检测var heartCheck = {timeout: 5...