GithubHelp home page GithubHelp logo

datachannel's People

Contributors

at-wat avatar backkem avatar boks1971 avatar ckousik avatar daonb avatar edaniels avatar enobufs avatar hugoarregui avatar kc5nra avatar normanr avatar pionbot avatar renovate-bot avatar renovate[bot] avatar sean-der avatar sirzooro avatar stv0g avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

datachannel's Issues

ChannelTypeReliableUnordered test fails with timeout [windows]

Version: b9a54c5

$ go test -v
=== RUN   TestDataChannel
=== RUN   TestDataChannel/ChannelTypeReliableOrdered
=== RUN   TestDataChannel/ChannelTypeReliableUnordered
goroutine profile: total 9
2 @ 0x3fbb36 0x40b232 0x4f7251 0x429961
#       0x4f7250        github.com/pion/sctp.(*Association).writeLoop+0x230     C:/Users/shell/go/pkg/mod/github.com/pion/[email protected]/association.go:559

2 @ 0x3fbb36 0x40b232 0x518865 0x4f67fe 0x429961
#       0x518864        github.com/pion/transport/test.(*bridgeConn).Read+0x124 C:/Users/shell/go/pkg/mod/github.com/pion/[email protected]/test/bridge.go:73
#       0x4f67fd        github.com/pion/sctp.(*Association).readLoop+0x15d      C:/Users/shell/go/pkg/mod/github.com/pion/[email protected]/association.go:510

1 @ 0x3fbb36 0x3c686c 0x3c6298 0x496ab5 0x4986ce 0x495e62 0x49857f 0x4972dd 0x56124b 0x3fb797 0x429961
#       0x496ab4        testing.(*T).Run+0x374          C:/Program Files/Go/src/testing/testing.go:1307
#       0x4986cd        testing.runTests.func1+0x6d     C:/Program Files/Go/src/testing/testing.go:1598
#       0x495e61        testing.tRunner+0x101           C:/Program Files/Go/src/testing/testing.go:1259
#       0x49857e        testing.runTests+0x43e          C:/Program Files/Go/src/testing/testing.go:1596
#       0x4972dc        testing.(*M).Run+0x51c          C:/Program Files/Go/src/testing/testing.go:1504
#       0x56124a        main.main+0x14a                 _testmain.go:59
#       0x3fb796        runtime.main+0x216              C:/Program Files/Go/src/runtime/proc.go:255

1 @ 0x3fbb36 0x3c686c 0x3c6298 0x496ab5 0x55c4a5 0x495e62 0x429961
#       0x496ab4        testing.(*T).Run+0x374                                  C:/Program Files/Go/src/testing/testing.go:1307
#       0x55c4a4        github.com/pion/datachannel.TestDataChannel+0x164       D:/git/pion/datachannel/datachannel_test.go:347
#       0x495e61        testing.tRunner+0x101                                   C:/Program Files/Go/src/testing/testing.go:1259

1 @ 0x3fbb36 0x3c686c 0x3c62d8 0x558b17 0x558afe 0x55c850 0x495e62 0x429961
#       0x558b16        github.com/pion/sctp.(*Association).AcceptStream+0x36   C:/Users/shell/go/pkg/mod/github.com/pion/[email protected]/association.go:1315
#       0x558afd        github.com/pion/datachannel.Accept+0x1d                 D:/git/pion/datachannel/datachannel.go:116
#       0x55c84f        github.com/pion/datachannel.TestDataChannel.func2+0x2ef D:/git/pion/datachannel/datachannel_test.go:373
#       0x495e61        testing.tRunner+0x101                                   C:/Program Files/Go/src/testing/testing.go:1259

1 @ 0x3fbb36 0x40b232 0x511bb1 0x429961
#       0x511bb0        github.com/pion/sctp.(*rtxTimer).start.func1+0xd0       C:/Users/shell/go/pkg/mod/github.com/pion/[email protected]/rtx_timer.go:151

1 @ 0x423425 0x4c3875 0x4c368d 0x4c082b 0x51ac65 0x429961
#       0x423424        runtime/pprof.runtime_goroutineProfileWithLabels+0x24   C:/Program Files/Go/src/runtime/mprof.go:746
#       0x4c3874        runtime/pprof.writeRuntimeProfile+0xb4                  C:/Program Files/Go/src/runtime/pprof/pprof.go:724
#       0x4c368c        runtime/pprof.writeGoroutine+0x4c                       C:/Program Files/Go/src/runtime/pprof/pprof.go:684
#       0x4c082a        runtime/pprof.(*Profile).WriteTo+0x14a                  C:/Program Files/Go/src/runtime/pprof/pprof.go:331
#       0x51ac64        github.com/pion/transport/test.TimeOut.func1+0x44       C:/Users/shell/go/pkg/mod/github.com/pion/[email protected]/test/util.go:21

panic: timeout

goroutine 55 [running]:
github.com/pion/transport/test.TimeOut.func1()
        C:/Users/shell/go/pkg/mod/github.com/pion/[email protected]/test/util.go:24 +0xa5
created by time.goFunc
        C:/Program Files/Go/src/time/sleep.go:180 +0x31
exit status 2
FAIL    github.com/pion/datachannel     10.495s

Invalid formatting for "Failed to handle DCEP" error

Your environment.

What did you do?

Intentionally hitting the error at

return fmt.Errorf("%w %s", ErrInvalidMessageType, msg)
uses %s for formatting but doesn't work for channelOpen (I think)

What did you expect?

A nicely formatted message.

What happened?

datachannel ERROR: 2021/11/09 02:46:57 Failed to handle DCEP: invalid Message Type &{%!s(datachannel.ChannelType=0) %!s(uint16=256) %!s(uint32=0) initial_data_channel }

DataChannel Read does not return EOF when remote closes stream

Your environment.

  • Version: 17674f6
  • Other Information - Added a test in this PR for EOF when a datachannel closes.

What did you do?

  1. Create a datachannel pair (A, B)
  2. Set a ReadDeadline on B of 2 seconds from the current time
  3. Issue a Read call on B.
  4. Call Close on A 100ms after step 2

PR for test: #161

What did you expect?

Read on B should return io.EOF.

What happened?

Read blocks until deadline is exceeded.

Docs: Add basics

Copy the style from pions/webrtc including readme, license, ... .

Do not use unordered until DATA_CHANNEL_ACK is received

Summary

"unordered" parameter at SCTP should not be set to true until DATA_CHANNEL_ACK is received.

Motivation

From draft-ietf-rtcweb-data-protocol-09, section 6:

   However, before the DATA_CHANNEL_ACK
   message or any other message has been received on a Data Channel, all
   other messages containing user data and belonging to this Data
   Channel MUST be sent ordered, no matter whether the Data Channel is
   ordered or not.

The ACK had been ignored until we started to parse the ack by the PR #9. Now, we should implement the above correctly.

Describe alternatives you've considered

SCTP later implements the partial-reliability, but it does not know receipt of DCEP ACK. DCEP has to tell SCTP layer how to enable "unordered". (We can use SetReliabilityParams() method it sctp.Stream provides.

Additional context

Relates to pions/webrtc#167

Implement data channel closing

https://tools.ietf.org/html/draft-ietf-rtcweb-data-channel-13#section-6.7

Closing of a data channel MUST be signaled by resetting the
corresponding outgoing streams [RFC6525]. This means that if one
side decides to close the data channel, it resets the corresponding
outgoing stream. When the peer sees that an incoming stream was
reset, it also resets its corresponding outgoing stream. Once this
is completed, the data channel is closed. Resetting a stream sets
the Stream Sequence Numbers (SSNs) of the stream back to 'zero' with
a corresponding notification to the application layer that the reset
has been performed. Streams are available for reuse after a reset
has been performed.

Add SetReadDeadline and SetWriteDeadline methods

Summary

Add methods to set deadlines for Read/Write from the datachannel. The underlying SCTP stream has a SetReadDeadline method that can be exposed for setting the Read deadline.

Motivation

The datachannel Read method seems to block until there is data or the channel is closed. To wrap a datachannel in a net.Conn we need to wrap it with the methods to set deadlines, and have the Read/Write calls execute in a separate goroutine. Using the methods already available on the SCTP stream would be efficient and make datachannels easier to use.

Describe alternatives you've considered

To implement SetReadDeadline, we run a loop that uses the current Read call to write to a buffer, and notifies the caller of completion of the Read via a channel. This allows us to await a timer in addition to completion of the Read.

Datachannel stalls after periods of inactivity, eventually automatically closes

Your environment.

  • Version: Pion v2.2.15
  • Browser: Chromium 83
  • Other Information - stacktraces, related issues, suggestions how to fix, links for us to have context

What did you do?

I use pion webrtc on the server with a browser client peer. Steps to reproduce issue:

  1. Establish peerconnection
  2. Open datachannel
  3. Send messages and confirm they are received
  4. Wait 2-5min (this time is nondeterministic)
  5. Try to send messages

NOTE: this only happens when establishing a connection directly using UDP STUN. This doesn't seem to happen when using a TURN server in TCP mode

What did you expect?

Expect the datachannel connection to remain stable and messages sent to be received on the server. I used to use node-webrtc before porting the code to golang (https://github.com/node-webrtc/node-webrtc), datachannel used to be quite a bit stable there.

What happened?

OnMessage events stop firing in response to data sent by the browser, even though the datachannel remains in the "open" state on the browser. Sometimes, after much more time passes, the datachannel goes into the "closed" state. In between this time, it's in a limbo of being unusable for extended lengths of time. The peerconnection stays open throughout the entire duration.

Setup CI

Copy the configuration from pions/webrtc.

Can the pion dataChannel project be compiled to WASM (WebAssembly) to be used in a non-browser environment with WASM runtime?

There is a general demand on using DataChannel in non-browser environment with WASM runtime and Javascript support, such as in nodeJS or in other standalone environments.

Can the pion dataChannel project be compiled to WASM (WebAssembly) to be used in a non-browser environment with WASM runtime?

Another question is, is the pion DataChannel project independent from the whole pion WetRTC project ? I think the compiled library of pion DataChannel project should be more lightweight.

Can anybody help on the questions ?

Action Required: Fix Renovate Configuration

There is an error with this repository's Renovate configuration that needs to be fixed. As a precaution, Renovate will stop PRs until it is resolved.

Error type: undefined. Note: this is a nested preset so please contact the preset author if you are unable to fix it yourself.

Dependency Dashboard

This issue provides visibility into Renovate updates and their statuses. Learn more

This repository currently has no open or pending branches.


  • Check this box to trigger a request for Renovate to run again on this repository

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.