Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions rpc/dialer.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (
"golang.org/x/net/proxy"
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/connectivity"
"google.golang.org/grpc/credentials"
"google.golang.org/grpc/credentials/insecure"
"google.golang.org/grpc/keepalive"
Expand Down Expand Up @@ -61,6 +62,9 @@ type Dialer interface {
Close() error
}

// Unknown is an unknown connectivity state.
const Unknown connectivity.State = 5

// A ClientConn is a wrapper around the gRPC client connection interface but ensures
// there is a way to close the connection.
type ClientConn interface {
Expand All @@ -70,6 +74,8 @@ type ClientConn interface {
// a PeerConnection.
PeerConn() *webrtc.PeerConnection
Close() error

GetState() connectivity.State
}

// A ClientConnAuthenticator supports instructing a connection to authenticate now.
Expand Down
6 changes: 6 additions & 0 deletions rpc/wrtc_client_channel.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
grpc_logging "github.com/grpc-ecosystem/go-grpc-middleware/logging"
"github.com/viamrobotics/webrtc/v3"
"google.golang.org/grpc"
"google.golang.org/grpc/connectivity"
"google.golang.org/grpc/metadata"
"google.golang.org/protobuf/proto"
"google.golang.org/protobuf/types/known/durationpb"
Expand Down Expand Up @@ -333,6 +334,11 @@ func (ch *webrtcClientChannel) writeReset(stream *webrtcpb.Stream) error {
})
}

// GetState returns the current connectivity state of the channel.
func (ch *webrtcClientChannel) GetState() connectivity.State {
return Unknown
Comment on lines +338 to +339
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe add a TODO here?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ya, can you make a ticket and add a TODO here?

}

func newClientLoggerFields(fullMethodString string) []any {
service := path.Dir(fullMethodString)[1:]
method := path.Base(fullMethodString)
Expand Down
Loading