Skip to content

Commit

Permalink
FIX: The creation of multiple relay datachannel failed. Procedure (#631)
Browse files Browse the repository at this point in the history
* fix: The creation of multiple relay datachannel failed. Procedure

* Update relay.go

Co-authored-by: Kevin Wang <[email protected]>
  • Loading branch information
upeartaker and kevmo314 authored Dec 22, 2021
1 parent 8bd68ab commit c8cea05
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/relay/relay.go
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ func (p *Peer) CreateDataChannel(label string) (*webrtc.DataChannel, error) {

func (p *Peer) createDataChannel(label string) (*webrtc.DataChannel, error) {
idx := p.dcIndex
p.dcIndex = +1
p.dcIndex++
dcParams := &webrtc.DataChannelParameters{
Label: label,
ID: &idx,
Expand Down
1 change: 1 addition & 0 deletions pkg/sfu/publisher.go
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@ func (p *Publisher) Relay(signalFn func(meta relay.PeerMeta, signal []byte) ([]b
dc, err := rp.CreateDataChannel(lbl)
if err != nil {
Logger.V(1).Error(err, "Creating data channels.", "peer_id", p.id)
continue
}
dc.OnMessage(func(msg webrtc.DataChannelMessage) {
if peer == nil || peer.Subscriber() == nil {
Expand Down

0 comments on commit c8cea05

Please sign in to comment.