Microsoft.R.Host.Client.RHost.ReceiveMessageAsync C# (CSharp) Method

ReceiveMessageAsync() private method

private ReceiveMessageAsync ( CancellationToken ct ) : Task
ct System.Threading.CancellationToken
return Task
        private async Task<Message> ReceiveMessageAsync(CancellationToken ct) {
            Message message;
            try {
                message = await _transport.ReceiveAsync(ct);
            } catch (MessageTransportException ex) when (ct.IsCancellationRequested) {
                // Network errors during cancellation are expected, but should not be exposed to clients.
                throw new OperationCanceledException(new OperationCanceledException().Message, ex);
            }

            if (message != null) {
                _log.Response(message.ToString(), _rLoopDepth);
            }

            return message;
        }