websocket与服务端连接后为啥一直PING PONG
// 请把代码文本粘贴到下方(请勿用图片代替代码)
var url = "ws://192.168.100.209:61614/stomp"; var topic = 'emp.alarm.empAlarmRecord'; var passcode = "admin"; var login = "admin"; var client = Stomp.client(url); var onconnect = function(frame) { client.subscribe(topic, function(message) { console.log(message); }); }; client.connect(login, passcode, onconnect);
<<< CONNECTED
server:ActiveMQ/5.15.4
heart-beat:10000,10000
session:ID:HTGWSoft-54998-1535002324404-5:17
version:1.1
PING
PONG
PING
PONG
素胚勾勒不出你
相关分类