public async Task <BaseCommand> Send(CommandConnect command, CancellationToken cancellationToken) { ThrowIfDisposed(); Task <BaseCommand>?responseTask; using (await _lock.Lock(cancellationToken).ConfigureAwait(false)) { responseTask = _channelManager.Outgoing(command); var sequence = Serializer.Serialize(command.AsBaseCommand()); await _stream.Send(sequence).ConfigureAwait(false); } return(await responseTask.ConfigureAwait(false)); }
public Task <BaseCommand> Send(CommandConnect command, CancellationToken cancellationToken) => SendRequestResponse(command.AsBaseCommand(), cancellationToken);
public async Task <BaseCommand> Send(CommandConnect command) => await SendRequestResponse(command.AsBaseCommand());