Пример #1
0
        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));
        }
Пример #2
0
 public Task <BaseCommand> Send(CommandConnect command, CancellationToken cancellationToken)
 => SendRequestResponse(command.AsBaseCommand(), cancellationToken);
Пример #3
0
 public async Task <BaseCommand> Send(CommandConnect command) => await SendRequestResponse(command.AsBaseCommand());