0

I am using RTC datachannel to transfer data (about 200kb) every 100ms( using timeout) between two peers( both chrome browsers, one windows pc n other mac).

For some reason, suddenly for no reason, in general after approx 5 minutes, one of the peers stop receiving the data, after some more time, the other peer also stops receiving the data.

After lot of debugging, I found out that both peers are still transmitting the data, and from network traffic analysis, it was clear that the other machine is receiving the data, but the browser does not invoke channel.onmessage.

part of my code:

function timepot1(){ // I have cheked, this keeps getting called, no problem here

    try {
         ....
         channel.send(JSON.stringify(jsObject));
    }catch (err) {
        console.log(err);
    }   
    setTimeout(timepot1, 100);
};

is there some known bug that is causing this, or is it because I am transferring large amount of data from both peers on same channel at same time?


EDIT

Apparently, I was using two datachannels( one for transmission in each direction), when I changed to single channel. It stopped working much quicker.

this is going sound stupid, but when I clear the console( in chrome browser) the receiving of data on that browser stops almost immediately( but eh machine still receives the data ).

mido
  • 24,198
  • 15
  • 92
  • 117
  • I would say it s a bug and I would report it to the corresponding browser vendor. – Dr. Alex Gouaillard Jan 14 '15 at 06:03
  • Agreed - report to Chrome. Try it in Firefox (nightly, and perhaps a debug build) and if so, you can get debugs via NSPR_LOG_MODULES=datachannel:5,sctp:5,timestamp -- this also lets you dump the SCTP packets to wireshark if needed via an icky alias: (tcsh alias): alias log2pcap 'grep "SCTP_PACKET" \!:1 | text2pcap -D -n -l 248 -t "%H:%M:%S." - \!:2' – jesup Jan 20 '15 at 16:59

1 Answers1

0

There was a bug in Chrome (actually usrsctp lib) which was mis-handling the wrapping of a 16 bit sequence counter if it occurred in the middle of a longer message. It is fixed now - so it would be worth trying your code again. See: Chromium issue 664283

Tim Panton
  • 469
  • 3
  • 4