webrtc-org icon indicating copy to clipboard operation
webrtc-org copied to clipboard

DataChannel is not stable

Open hungdx6 opened this issue 4 years ago • 0 comments

Hi dev team,

I have implemented an Android app that transfer data between 2 devices. But the DataChannel object is not stable. After some message, the DC object is null. I used observer to hook CLOSING and CLOSED event and recreate another DC with other label. But the DC still null after that. Please help me

Here is my code:

public void onDataChannelDisconnected(String peer_id) { Controller.this.rtcClient.getPeer(peer_id).CreateDataChannel(); }

public void CreateDataChannel() { DataChannel.Init init = new DataChannel.Init(); init.negotiated = false; init.ordered = true; init.maxRetransmits = 30; this.dc = pc.createDataChannel(UUID.randomUUID().toString(), init); }

hungdx6 avatar Jul 28 '21 11:07 hungdx6