WebRTC.org website (*** This repository is deprecated ***) - The documentation to contribute to native code is available at https://webrtc.googlesource.com/src/+/refs/heads/master/docs/native-code/index.md, info about WebRTC is available at https://webrtc.org)
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);}
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);
}