docs icon indicating copy to clipboard operation
docs copied to clipboard

Port, redirect and modernize all .NET networking content.

Open IEvangelist opened this issue 1 year ago • 1 comments

Port, redirect and modernize all .NET networking content. There is a whole sub-doc-set located here:

Much of this content is severely out-of-date, and many code examples reference obsolete APIs. The strategy is to move (port) conceptual content from the Network Programming in the .NET Framework under the modern .NET Fundamentals / Runtime Libraries / Networking TOC:

image

We should converge the existing HTTP-specific content under a new TOC node, .NET Fundamentals / Runtime Libraries / Networking / HTTP. Then we should create several new nodes to capture content specific to additional protocols, such as TCP, UDP, FTP, WebSockets, and whatever else I might be missing. A lot of the legacy content specific to .NET Framework can be modernized and code samples updated accordingly.

Asynchronous patterns such as:

  • Begin{X} / End{X}
  • AsyncCallback
  • IAsyncResult

Should be removed in favor of, async/await, Task, and ValueTask (or other task-like alternatives). conceptual rewrites should strive to serve new learned audiences, making adoption easy.

/cc @richlander

IEvangelist avatar Jul 28 '22 17:07 IEvangelist

This looks great and has very high value. Turns out that modern scenarios require a lot of networking, right?

Some things to consider (likely as advanced scenarios; unordered):

  • Sync over async
  • Transport-agnostic APIs (both producing and consuming)
  • How to wrap those old async patterns. I agree we don't want folks producing new code that uses those patterns, but interacting with them may still be required for some scenarios.
  • Using all the modern networking patterns like circuit breakers. If those are not available in-box, which libraries should folks use to take advantage of those.
  • How to handle flaky networkings, including cellular
  • Are there any scenarios where .NET devs need to reason about LTE vs 5G for cell links?
  • Networking in containers
  • Global vs local DNS (including sidecars)
  • Unix domain sockets vs DNS
  • HTTPS/TLS termination
  • When to use HTTP, HTTPS, HTTP/2, HTTP/3 (and which capabilities are (not) supported for each, if relevant). AFAIK, there are valid use cases for all of these. For example, I know some folks terminate TLS at the load balancer (if that's the correct term) and then use raw HTTP between nodes. There are pros and cons with that.
  • ValueTask should probably be considered an advanced scenario. Would be good to validate that.
  • Stream vs Pipelines

@davidfowl

richlander avatar Jul 30 '22 18:07 richlander

We do have coverage of Pipelines, and it is discussed in the context of I/O and streams:

IEvangelist avatar Aug 17 '22 13:08 IEvangelist