diff --git a/pkg/relay/relay.go b/pkg/relay/relay.go index eafc15d7d..308d0643f 100644 --- a/pkg/relay/relay.go +++ b/pkg/relay/relay.go @@ -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, diff --git a/pkg/sfu/publisher.go b/pkg/sfu/publisher.go index 36efa66b4..417cec9a0 100644 --- a/pkg/sfu/publisher.go +++ b/pkg/sfu/publisher.go @@ -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 {