Exemplo n.º 1
0
        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;
            }
        }
Exemplo n.º 2
0
 public void Dispose()
 {
     _socket?.Dispose();
 }