Commit Graph

39 Commits

Author SHA1 Message Date
Sean DuBois
634a904ba9 Fire OnBufferedAmountLow in a goroutine
If a user blocks this routine it would stop inbound message handling in
SCTP. To reduce the sharp edge fire it in a goroutine so users don't
need to worry about blocking.

`data-channels-flow-control` exhibited no differences in throughput from
this change.

Resolves #846
2025-09-11 11:32:00 -07:00
Sean DuBois
43c27b7a5e Fix race in TestDetachRemovesDatachannelReference
Don't use same error in goroutine
2025-04-08 11:58:31 -04:00
Joe Turki
740e5166c5 Update lint rules, force testify/assert for tests
Use testify's assert package instead of the standard library's testing
package.
2025-03-27 12:08:37 +02:00
Sean DuBois
e4ff415b2b Support DataChannel messages larger then MaxUint16
SCTP now internally can handle larger messages

Resolves #2712
2025-03-04 18:22:14 -08:00
Joe Turki
feeeebf251 Upgrade golangci-lint, more linters
Introduces new linters, upgrade golangci-lint to version (v1.63.4)
2025-01-18 07:16:06 -06:00
Pablo Fuente Pérez
fe41afd3f2 Fix deadlock in DataChannel with mutex unlock
Fulfill request changes in PR 3009

Close answer and assert errors in detach tests
2025-01-16 13:11:57 +01:00
Joe Turk
c895252d72 Gracefully close connecting channels (#2991)
Fixes an issue where calling dataChannel.Close on
'connecting' state channels didn't work as expected.
When handling the `OnOpen` event detect if the
user has requested close.

Fixes #2659
2025-01-08 09:57:55 -05:00
Pion
752e442994 Update CI configs to v0.11.15
Update lint scripts and CI configs.
2024-08-16 14:13:11 -04:00
Sean DuBois
1d451b568c Update go.mod version to 1.19
Relates to pion/webrtc#2292
2024-04-02 22:54:57 -04:00
sukun
835ac3b08e Drop reference to detached datachannels
This allows users of detached datachannels to garbage collect
resources associated with the datachannel and the sctp stream.
There is no functional change here.
2024-03-24 22:21:35 -04:00
Sean DuBois
fda6c4f836 Fix linter errors
golangci-lint upgrade to v1.56.2 added more checks

Relates to pion/.goassets#201
2024-03-16 21:09:38 -04:00
renovate[bot]
ea23dec2b9 Update module transport, srtp, ice and turn
ReplayDetector introduced a breaking change
2023-09-03 23:59:43 -04:00
Steffen Vogel
683fc837d0 Make repo REUSE compliant 2023-05-05 11:58:49 -04:00
Yutaka Takeda
cf60891524 Fix ignored calls during OnDataChannel
Set cached values passed by SetBufferedAmountLowThreshold and
OnBufferedAmountLow correctly when the underlying datachannel become
open
2023-03-26 23:32:54 -04:00
Steffen Vogel
eafdc7742a Use new pion/transport Net interface
This change adapts pion/ice to use a new interface for most network
related operations. The interface was formerly a simple struct vnet.Net
which was originally intended to facilicate testing. By replacing it
with an interface we have greater flexibility and allow users to hook
into the networking stack by providing their own implementation of
the interface.
2023-02-09 09:39:33 +01:00
treyhakanson
657dab7b97 Adding OnDial handler for datachannels
Adds an `OnDial` handler to be fired once the dialing side has sent
the DCEP OPEN message over the data channel.
2023-02-01 22:03:28 -08:00
Pion
5b4afbb934 Update CI configs to v0.7.5
Update lint scripts and CI configs.
2022-05-09 12:08:35 -04:00
Sean DuBois
157220e800 Run gofmt to add new build constraints
Also remove some 1.13 specific WASM code
2022-01-17 22:36:01 -05:00
Sean DuBois
9c7b365144 Use closePairNow in tests
Instead of explicitly closing each PeerConnection use helper.
No change in test behavior, just makes code more consistent.
2021-02-16 15:47:58 -08:00
Sean DuBois
5a3d41ed77 Use proper values for application media section
Update from draft-ietf-mmusic-sctp-sdp
2020-12-23 23:44:23 -08:00
Sean DuBois
49ddb9dab8 Make DataChannel.ReadyState atomic
Fix deadlock, see trace in issue

Resolves #1531
2020-11-16 13:49:25 -08:00
Sean DuBois
804a12fed3 Update CI configs to v0.4.7
Update lint scripts and CI configs.
2020-09-30 09:06:34 -07:00
soolaugust
6f6de25b24 Modify all hdlr to handler for better reading
change hdlr -> handler, Hdlr -> Handler for better reading.
Since this is first commit, add myself to contributors
2020-08-17 22:04:29 -07:00
Atsushi Watanabe
b457163d6d Discard double close error of dtls conn
sctp.Stream.Close() closes inner dtls connection.
2020-03-24 19:14:25 +09:00
Patrick Lange
e9ac852048 Detach datachannel in OnOpen inside test
When using DetachDataChannels, the user should Detach the channel
inside the OnOpen method. Our own test case should use the same
approach to avoid confusion.
2019-12-10 21:35:34 -08:00
Sean DuBois
721b342e2e Properly generate DataChannel streamId
Before we computed DataChannel IDs before signaling, this
is incorrect because IDs must take into account if we are
running an DTLS Client or Server.

This updates the DataChannel ID generation code to take this
into account before generating a streamId.

Resolves #908
2019-11-14 10:51:05 -08:00
Sean DuBois
2356373aac Fix all routine leaks in tests
Fix tests that didn't properly close and add
test.CheckRoutines everywhere. No changes in pion/webrtc
but we did catch hanging thread in pion/ice
2019-10-24 00:09:43 -07:00
Yutaka Takeda
d793fcff97 Fix test
Relates to pion/sctp#45
2019-10-23 12:18:48 -07:00
Vicken Simonian
5f25df2209 Various spell fixes
For error types, vars, docs and comments
2019-10-17 23:31:21 -07:00
Sean DuBois
6088c7beed Add failing test for RTCDataChannel protocol
This currently only passes on WASM, but shows that we
diverge in Golang implementation

Relates to #748
2019-09-27 16:19:49 -07:00
Sean DuBois
d54b494292 Remove RTCDataChannel priority
This has been removed from webrtc-pc[0]

Relates to #748

[0] https://github.com/w3c/webrtc-pc/issues/2258
2019-09-26 15:44:19 -07:00
Yutaka Takeda
434745c489 Fix race in TestEOF
Resolves #652
2019-05-07 17:33:30 -07:00
Yutaka Takeda
d4ea7e3838 Upadate sctp datachannel
Relates to #652
2019-05-07 17:33:30 -07:00
Yutaka Takeda
c7a5c7b0c1 Impleted bufferedAmount interface
Resolves #569
2019-04-06 15:52:49 -07:00
Sean DuBois
1cdfc10c84 Mass replace pions -> pion
Pions organization was renamed to pion
2019-04-04 15:32:03 -07:00
Alex Browne
5ee8b1a5c5 Add ICE candidate event handlers
Add OnICECandidate and OnICEGatheringStateChange methods to
PeerConnection. The main goal of this change is to improve API
compatibility with the JavaScript/Wasm bindings. It does not actually
add trickle ICE support or change the ICE candidate gathering process,
which is still synchronous in the Go implementation. Rather, it fires
the appropriate events similar to they way they would be fired in a true
trickle ICE process.

Remove unused OnNegotiationNeeded event handler. This handler is not
required for most applications and would be difficult to implement in
Go. This commit removes the handler from the JavaScript/Wasm bindings,
which leads to a more similar API for Go and JavaScript/Wasm.

Add OnICEGatheringStateChange to the JavaScript/Wasm bindings. Also
changes the Go implementation so that the function signatures match.
2019-03-25 14:22:11 -07:00
Alex Browne
5ab753c43e Combine some tests for Go and Wasm
This is now possible because the properties in the Go implementation
were changed to methods, which more closely matches the Wasm bindings.
Previously we needed two separate tests because of differences in the
two APIs.
2019-03-19 13:44:35 -07:00
Yutaka Takeda
8bd831fafe Change public DataChannel props to methods
Resolves #505
2019-03-19 08:33:18 -07:00
Alex Browne
34e5a89f71 Add tests for WASM bindings
The tests are run in a Node.js environment, and this does not include
any browser tests. This requires the wrtc package from npm as well as a
shim which adds portions of the WebRTC API to the global scope.

Some tests introduced here can be combined when differences between the
Go API and the WASM bindings are addressed and as missing features are
added to the WASM bindings.

We can and should add more tests in the future to improve test coverage.
This should be considered the minimum number of tests reuqired to ensure
basic functionality is working.
2019-03-15 15:17:51 -07:00