SendAsync
SendAsync is an asynchronous API operation that sends a request or data and represents its completion and result asynchronously.
C# Concurrency: Asynchronous and multithreaded programming
SendAsync is an asynchronous socket operation that transfers data and represents completion with a task containing the accepted byte count.
- How it is used
- Uses asynchronous socket sending to serve concurrent connections without blocking a dedicated thread during each transfer.
- How deep it goes
- Defines task completion and accepted-byte semantics, then demonstrates SendAsync inside an asynchronous file-serving loop.
- Examples
- Uses an asynchronous TCP file server that sends one-megabyte buffer segments after reading them asynchronously.
- What you can do after
- Apply it via C# Socket APIs to asynchronously send buffer segments and inspect the accepted byte count.
Read how C# Concurrency: Asynchronous and multithreaded programming explains SendAsync →
ASP.NET Core in Action, 3e
SendAsync is the asynchronous HttpMessageHandler method that processes an HTTP request and returns its response.
- How it is used
- Uses SendAsync to implement cross-cutting HTTP behavior such as authentication, logging, metrics, and request retries.
- How deep it goes
- Explains overriding, request modification, pipeline forwarding, response inspection, registration, and handler ordering.
- Examples
- Demonstrates an API-key handler that adds a header before forwarding requests through a typed-client pipeline.
- What you can do after
- Apply it via DelegatingHandler to customize outgoing requests and process responses in an HttpClient pipeline.
Related concepts
- HttpMessageHandlerpart of · HttpMessageHandler is an abstract .NET component that processes HTTP request and response messages within an HttpClient handler chain.
- AcceptAsynccontrasts with · AcceptAsync is an asynchronous socket operation that returns a Task<Socket> completing when an incoming connection arrives.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.

