<PackageReference Include="Grpc.Net.Client" Version="2.80.0-pre1" />

Grpc.Net.Client.Balancer.Internal.SocketConnectivitySubchannelTransport

Transport that makes it possible to monitor connectivity state while using HttpClient. Features: 1. When a connection is requested the transport creates a Socket and connects to the server. The socket is used with the first stream created by SocketsHttpHandler.ConnectCallback. The transport keeps track of the socket or the streams in use to determine if the connection is ready. Connectivity API features require knowing whether there is a connection available. A limitation of the .NET support is only socket connectivity to the server is tracked. This transport is unable to check whether TLS and HTTP is succcessfully negotiated. 2. Transport supports multiple addresses. When connecting it will iterate through the addresses, attempting to connect to each one.
namespace Grpc.Net.Client.Balancer.Internal { internal sealed class SocketConnectivitySubchannelTransport : ISubchannelTransport, IDisposable { public DnsEndPoint CurrentEndPoint { get; } public TimeSpan? ConnectTimeout { get; } public TransportStatus TransportStatus { get; } public SocketConnectivitySubchannelTransport(Subchannel subchannel, TimeSpan socketPingInterval, TimeSpan? connectTimeout, TimeSpan socketIdleTimeout, ILoggerFactory loggerFactory, Func<Socket, DnsEndPoint, CancellationToken, ValueTask> socketConnect); public void Disconnect(); public ValueTask<ConnectResult> TryConnectAsync(ConnectContext context, int attempt); public ValueTask<Stream> GetStreamAsync(DnsEndPoint endPoint, CancellationToken cancellationToken); public void Dispose(); } }