webrtc-org
webrtc-org copied to clipboard
DataChannel is not stable
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);
}