Welcome to MLink Developer Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
185 views
in Technique[技术] by (71.8m points)

onping事件不能触发

服务端(用的ws,node.js)发送了一个ping事件但是客户端这里的onping却没有触发,这是为什么啊?

//server
wss.on("connection", function connection(ws) {
    ws.on('message', function(message) {
        console.log('received: %s', message);
    });

    ws.ping('ping');
});
//client
 ws.onping = function () {
            console.log('receive ping');
        };

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to MLink Developer Q&A Community for programmer and developer-Open, Learning and Share
...