diff --git a/lib/src/rpc/dial.dart b/lib/src/rpc/dial.dart index d9aa5e8473..c6be71178a 100644 --- a/lib/src/rpc/dial.dart +++ b/lib/src/rpc/dial.dart @@ -612,19 +612,3 @@ _HostAndPort _hostAndPort(String address, bool insecure) { } return _HostAndPort(host, port); } - -/// A channel that adds session data (if required) to gRPC metadata for every call -class ClientChannelWithSessions extends GrpcOrGrpcWebClientChannel { - final String Function() _sessionId; - - ClientChannelWithSessions.toSingleEndpoint(this._sessionId, {required super.host, required super.port, required super.transportSecure}) - : super.toSingleEndpoint(); - - @override - ClientCall createCall(ClientMethod method, Stream requests, CallOptions options) { - if (!SessionsClient.unallowedMethods.contains(method.path)) { - options = options.mergedWith(CallOptions(metadata: {SessionsClient.sessionMetadataKey: _sessionId()})); - } - return super.createCall(method, requests, options); - } -} diff --git a/lib/src/rpc/web_rtc/web_rtc_client.dart b/lib/src/rpc/web_rtc/web_rtc_client.dart index b4ed257abe..ec3afd57f0 100644 --- a/lib/src/rpc/web_rtc/web_rtc_client.dart +++ b/lib/src/rpc/web_rtc/web_rtc_client.dart @@ -35,4 +35,11 @@ class WebRtcClientChannel extends ClientChannelBase { options = options.mergedWith(CallOptions(metadata: {'viam_client': getVersionMetadata()})); return super.createCall(method, requests, options); } + + @override + Future shutdown() async { + await rtcPeerConnection.close(); + await dataChannel.close(); + return super.shutdown(); + } }