[RSDK-8293] Pass in Connection to Answerer in WebRTC Server#410
Merged
bashar-515 merged 19 commits intoviamrobotics:mainfrom Feb 5, 2025
Merged
[RSDK-8293] Pass in Connection to Answerer in WebRTC Server#410bashar-515 merged 19 commits intoviamrobotics:mainfrom
bashar-515 merged 19 commits intoviamrobotics:mainfrom
Conversation
cheukt
requested changes
Jan 31, 2025
Member
cheukt
left a comment
There was a problem hiding this comment.
some comments but looks pretty good!
rpc/dial_options.go
Outdated
| } | ||
|
|
||
| // WithConn provides a preexisting connection to use. This option forces the webrtcSignalingAnswerer to not dial or manage a connection. | ||
| func WithConn(conn ClientConn) DialOption { |
Member
There was a problem hiding this comment.
maybe ExternalSignalerConn? we should be clear that this would be used for the external signaler answerer
rpc/wrtc_signaling_answerer.go
Outdated
| bgWorkers: bgWorkers, | ||
| logger: logger, | ||
| } | ||
| if options.conn != nil { |
Member
There was a problem hiding this comment.
the internal signaler answer shouldn't be using the same connection - it is instantiated here
Lines 659 to 665 in cf6c56e
Member
Author
There was a problem hiding this comment.
This doesn't require any change does it, since its instantiation has its own fresh set of options passed?
cheukt
reviewed
Jan 31, 2025
Member
cheukt
left a comment
There was a problem hiding this comment.
this looks generally good, will hold off on approving until the corresponding RDK pr is in
rpc/dial_options.go
Outdated
| } | ||
|
|
||
| // WithConn provides a preexisting connection to use. This option forces the webrtcSignalingAnswerer to not dial or manage a connection. | ||
| func WithConn(externalSignalerConn ClientConn) DialOption { |
cheukt
approved these changes
Feb 4, 2025
rpc/dial_options.go
Outdated
| unaryInterceptor grpc.UnaryClientInterceptor | ||
| streamInterceptor grpc.StreamClientInterceptor | ||
|
|
||
| // conn can be used to force the webrtcSignalingAnswerer to use a preexisting connection instead of dialing and managing its own. |
Member
There was a problem hiding this comment.
Suggested change
| // conn can be used to force the webrtcSignalingAnswerer to use a preexisting connection instead of dialing and managing its own. | |
| // signalingConn can be used to force the webrtcSignalingAnswerer to use a preexisting connection instead of dialing and managing its own. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR allows for a preexisting connection to be passed to the constructor for our WebRTC signaling answerer to use via a dial option.
Testing
4 cases:
@cheukt and I ran the first tests by running viam-server on my laptop while connected to the Viam-Guest WiFi. He ran a client Go script on his laptop connected to the Viam WiFi. The client was able to connect to the robot via WebRTC both times.