Pass the deadline to the operation that can cancel the network work. For an existing proxy-configured .NET HttpClient:

using var deadline = new CancellationTokenSource(TimeSpan.FromSeconds(20));
using var response = await client.GetAsync(uri, deadline.Token);

The application supplies client and uri. This overload receives the cancellation token; a timeout around waiting for its task would only limit that caller's wait. Polling a completion flag has the same problem: the caller can leave while sockets and workers remain occupied.

Cancellation follows the client's implementation and cleanup path. It does not promise that every lower-level action stops at an exact instruction. Allow that path to finish and dispose of the resources the operation owns. Include separately controlled body reading in the design; for a modern .NET ResponseHeadersRead operation, pass the same token through the body read. Other clients provide their own cancellation, abort and cleanup interfaces.

A retry needs an outcome for the previous attempt. Keep its identifier and selected proxy, request cancellation when required and avoid losing the task while starting replacements indefinitely. Otherwise a slow endpoint can accumulate work faster than the application releases it.

The remote outcome needs separate handling. The destination may already have received a submission when cancellation occurs. Use the application's recovery or idempotency policy; stopping local work does not undo a remote action.

Allakkat attuumassuteqartut