我有这个 websocket 的代码。我想为 lRes 调用函数广播。我怎样才能做到这一点?
var lRes = jwsc.logon('ws://localhost/WS', 'sendToWS', 'root', {
// OnOpen callback
OnOpen: function(aEvent) {
},
// broadcast callback
broadcast: function() {
var lRes = jwsc.broadcastText(
"",
lMsg // broadcast this message
);
},
// OnMessage callback
OnMessage: function(aEvent, aToken) {
},
// OnClose callback
OnClose: function(aEvent) {
},
});