Skip to content

Remove the offer sdp from peer.Join. fix #409 #410

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 8, 2021

Conversation

cloudwebrtc
Copy link
Contributor

@cloudwebrtc cloudwebrtc commented Feb 5, 2021

Separate the offer sdp parameter in the peer.Join method.
This allows for a more flexible signal design. The current modification does not affect the existing ion-sfu signaling but separates the first offer SDP from the join method. When the join fails, we don’t have to operate pc or create an offer on the client-side.

before:

                       answer, err := peer.Join(payload.Join.Sid, offer)
                        if err != nil {
                                switch err {
                                case sfu.ErrTransportExists:
                               ...
                        }

after:

                       err = peer.Join(payload.Join.Sid)
                        if err != nil {
                                switch err {
                                case sfu.ErrTransportExists:
                                  return sig.SendReply(JoinReply{Success: false, Error: sfu.ErrTransportExists })
                                case sfu.RoomIsFull:
                                  return sig.SendReply(JoinReply{Success: false, Error: sfu.RoomIsFull })
                                 ...
                        }
                        return sig.SendReply(JoinReply{Success: true, Error: nil })

                       ......

                       // recv description.
                       answer, err := peer.Answer(offer)
                       if err != nil {
                               return status.Errorf(codes.Internal, fmt.Sprintf("answer error: %v", err))
                       }

Reference issue

Fixes #409

@cloudwebrtc cloudwebrtc requested review from OrlandoCo, billylindeman and tarrencev and removed request for OrlandoCo and billylindeman February 5, 2021 15:26
@codecov
Copy link

codecov bot commented Feb 5, 2021

Codecov Report

Merging #410 (26782ca) into master (7925192) will decrease coverage by 0.21%.
The diff coverage is 63.49%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #410      +/-   ##
==========================================
- Coverage   41.35%   41.14%   -0.22%     
==========================================
  Files          21       21              
  Lines        2048     2022      -26     
==========================================
- Hits          847      832      -15     
+ Misses       1099     1087      -12     
- Partials      102      103       +1     
Impacted Files Coverage Δ
pkg/buffer/buffer.go 22.26% <0.00%> (ø)
pkg/sfu/session.go 49.47% <30.76%> (+7.47%) ⬆️
pkg/sfu/peer.go 58.25% <53.84%> (-3.62%) ⬇️
pkg/sfu/downtrack.go 32.86% <83.87%> (+5.91%) ⬆️
pkg/sfu/subscriber.go 63.76% <100.00%> (-6.35%) ⬇️
pkg/sfu/router.go 48.58% <0.00%> (+1.12%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7925192...3e6831a. Read the comment docs.

@billylindeman
Copy link
Contributor

It was originally this way, and @tarrencev added it to the join to streamline the process awhile back. thoughts @tarrencev

@tarrencev
Copy link
Collaborator

tarrencev commented Feb 6, 2021

i'm ok with these changes. before i wanted to simplify things as much as possible. but perhaps we should be more flexible

@cloudwebrtc cloudwebrtc requested a review from adwpc February 8, 2021 00:21
@adwpc
Copy link
Contributor

adwpc commented Feb 8, 2021

LGTM

@cloudwebrtc cloudwebrtc merged commit c893fde into master Feb 8, 2021
@cloudwebrtc cloudwebrtc deleted the remove_offer_sdp_from_join_method branch February 8, 2021 04:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove the offer parameter from peer.Join.
4 participants