Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ununderstandible behaviour of data channel #112

Open
stserakhau opened this issue Feb 14, 2023 · 0 comments
Open

Ununderstandible behaviour of data channel #112

stserakhau opened this issue Feb 14, 2023 · 0 comments
Assignees

Comments

@stserakhau
Copy link

stserakhau commented Feb 14, 2023

Test scenario:

Chunk size 15kb.
For 200 files (avg 5 parallel downloads)

  1. Open datachannel (line 1..5 below)
  2. Transmit 5Mb file (sending chunks via channel.send(RTCDataChannelBuffer))
  3. Close data channel (after receiving confirmation from receiver or by timeout (1 minute))

Result:
after ~100 successfully downloaded files I see next behaviour

After executing line 1..5 channel change state immediately to CLOSING -> CLOSED. State of the peerConnection = 'connected'

1. RTCDataChannelInit init = new RTCDataChannelInit();
2. init.priority = RTCPriorityType.VERY_LOW;
3. init.ordered = true;
4. RTCDataChannel fileChannel = rtcClient.peerConnection.createDataChannel(channelName, init);
5. fileChannel.registerObserver(new FileDownloaderRTCDataChannelObserver(fileChannel, fileResourceId, downloadStream));
6. 
7. class FileDownloaderRTCDataChannelObserver implements RTCDataChannelObserver {
8. ...
9.         @Override
10.         public void onStateChange() {
11.             File fileToTransmit = downloadStream.getFile();
12.             RTCDataChannelState state = fileChannel.getState();
13.             switch (state) {
14.                 case OPEN -> {
15.                     log.info("File download channel opened: {}", fileChannel.getLabel());
16.                     .......
17.                 }
18.                 case CLOSED -> {
19.                     log.info("File download channel closed: {}", fileChannel.getLabel());
20.                     ...
21.                 }
22.             }
23.         }
24. ...
25. }

Expected behaviour:
Channel should not closed after creation.

  • OS: Intel(R) Core(TM) i7-5820K CPU @ 3.30GHz, 12 cores, 31G, Windows 10 , 64 bit Build 19041 (10.0.19041.2364)
  • JRE version: Java(TM) SE Runtime Environment (17.0.2+8) (build 17.0.2+8-LTS-86)
  • webrtc 0.7.0
  • spring-boot 2.7.5

Additional context

  1. After reconnecting peer client (refresh page in browser) data channel beginning to work.
  2. Some strange on the Ethernet graphic in Task manager
    I see execution of the code below in debug mode
     RTCDataChannelBuffer channelBuffer = new RTCDataChannelBuffer(byteBuffer, true);
     channel.send(channelBuffer);

But I don't see the network traffic. states of peer connection = connected, channel = open (When file transmittion is active this line generates traffic 10-15 mbits)

@stserakhau stserakhau changed the title Ununderstandible behaviour of data channel - close immediately after open Ununderstandible behaviour of data channel Feb 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants