android - DataChannnel - can't send a message, send always returns false -
android - DataChannnel - can't send a message, send always returns false -
i followed advice http://stackoverflow.com/a/29466254/2813589 add together back upwards of datachannels in android apprtc applcation. here's part of code bit changed:
public class peerconnectionclient { //...... public void senddata(string sendstring) { bytebuffer sendbuffer=bytebuffer.wrap(sendstring.getbytes()); datachannel.buffer buf = new datachannel.buffer(sendbuffer, false); boolean res = dc.send(buf); // res false log.d(tag, "onsenddatachannelmessage(), sent: " + sendstring); log.d(tag, "onsenddatachannelmessage(), result: " + res); } //... } public class callactivity extends activity implements apprtcclient.signalingevents, peerconnectionclient.peerconnectionevents, callfragment.oncallevents { // never never executed @override public void ondatachannelmessage(string msg) { toast.maketext(this, msg, toast.length_short).show(); log.d(tag, "ondatachannelmessage(), received: " + msg); }
note original code returned "false" "send()"
what's that?
android webrtc
Comments
Post a Comment