You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I found nsConn has a function named emitBinary which can tarnsform data by binary. And I saw it in _examples\protobuf\browser\app.js. So I did a practice. But It doesn't work in nsConn.Room. My code like this
varroom="default_room"sendBtn.onclick=function(){constinput=inputTxt.value;inputTxt.value="";varpbMsg=newproto.protobuf.ChatMsg();pbMsg.setMsgtype(10000).setMsgbody(input);addMessage("Me: "+input+" --room "+room);// work correctnsConn.emitBinary("OnChat",pbMsg.serializeBinary());//error becasue emitBinary undefinednsConn.room(room).emitBinary("OnChat",pbMsg.serializeBinary())};
I read the examples again, and found this way to send a binary data in examle.
I found
nsConn
has a function namedemitBinary
which can tarnsform data by binary. And I saw it in_examples\protobuf\browser\app.js
. So I did a practice. But It doesn't work innsConn.Room
. My code like thisI read the examples again, and found this way to send a binary data in examle.
it works, Great!
But I want an easy way to write this code. So I changed
neffos.js
to implementRoom.emitBinary
.just add
a.prototype.emitBinary
, it works.I am not familiar with
typescripts
, so I make an issue whitout pull request.The text was updated successfully, but these errors were encountered: