public static async Task <IMessageStream> ConnectAsync(AddressEntry entry, ClientSetupResult connectionContext, CancellationToken cancellationToken) { TransportSocket socket = await TransportSocket.ConnectAsync(entry, cancellationToken, connectionContext.SupportsFdPassing).ConfigureAwait(false); try { Transport transport = new Transport(socket); await transport.DoClientAuth(entry.Guid, connectionContext.UserId).ConfigureAwait(false); return(transport); } catch { socket.Dispose(); throw; } }
public void Dispose() { _socket?.Dispose(); }