Skip to content
This repository was archived by the owner on Jan 5, 2026. It is now read-only.
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Runtime.InteropServices;
using System.Text.Json;
using System.Threading;
Expand Down Expand Up @@ -91,7 +92,7 @@ public async Task<ReceiveResponse> SendRequestAsync(StreamingRequest request, Ca
}
}

return await responseCompletionSource.Task.DefaultTimeOutAsync().ConfigureAwait(false);
return await responseCompletionSource.Task.DefaultTimeOutAsync().ConfigureAwait(false);
}

public async Task SendResponseAsync(Header header, StreamingResponse response, CancellationToken cancellationToken)
Expand Down Expand Up @@ -358,6 +359,8 @@ private void ProcessRequest(Guid id, ReceiveRequest request)
{
_ = Task.Run(async () =>
{
// Send an HTTP 202 (Accepted) response right away, otherwise, while under high streaming load, the conversation times out due to not having a response in the request/response time frame.
await SendResponseAsync(new Header { Id = id, Type = PayloadTypes.Response }, new StreamingResponse { StatusCode = (int)HttpStatusCode.Accepted }, _connectionCancellationToken).ConfigureAwait(false);
var streamingResponse = await _receiver.ProcessRequestAsync(request, null).ConfigureAwait(false);
await SendResponseAsync(new Header() { Id = id, Type = PayloadTypes.Response }, streamingResponse, _connectionCancellationToken).ConfigureAwait(false);

Expand Down