Skip to content

Commit

Permalink
Reorder calls to fix ice candidate not set when ice starts to trickle (
Browse files Browse the repository at this point in the history
  • Loading branch information
tmiv authored Jan 2, 2021
1 parent 5625391 commit ff430d3
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions cmd/signal/json-rpc/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,6 @@ func (p *JSONSignal) Handle(ctx context.Context, conn *jsonrpc2.Conn, req *jsonr
break
}

answer, err := p.Join(join.Sid, join.Offer)
if err != nil {
replyError(err)
break
}

p.OnOffer = func(offer *webrtc.SessionDescription) {
if err := conn.Notify(ctx, "offer", offer); err != nil {
log.Errorf("error sending offer %s", err)
Expand All @@ -76,6 +70,12 @@ func (p *JSONSignal) Handle(ctx context.Context, conn *jsonrpc2.Conn, req *jsonr
}
}

answer, err := p.Join(join.Sid, join.Offer)
if err != nil {
replyError(err)
break
}

_ = conn.Reply(ctx, req.ID, answer)

case "offer":
Expand Down

0 comments on commit ff430d3

Please sign in to comment.