The latest release of .NET 7 brings interesting features and additions to the networking space. 

A month after releasing the first version of .NET 7, Microsoft introduced a range of networking upgrades that cover the HTTP transport layer, APIs and security.

The updates reflect Microsoft’s belief that networking is critical to modern applications, as described last year by Richard Lander, project manager for the .NET team.

.NET needed some networking enhancements as unsuccessful connection attempts have historically been handled poorly. Although engineers improved these capabilities in .NET 6.0, the gains fell short, resulting in unexpected request failures and connection timeouts.

.NET 7 updates

HttpHeaders became more thread-safe in .NET 7. In .NET 6, it was quite easy to accidentally access headers simultaneously, which sometimes caused header values to be copied, edited or worse. .NET 7 made header behaviour safer by supporting concurrent HttpHeaders reads.

Furthermore, Microsoft updated Quick UDP Internet Connections (QUIC). The transport layer tool leverages UDP and makes TLS 1.3 mandatory.

“Another interesting difference from well-known transport protocols such as TCP and UDP is that it has stream multiplexing built-in on the transport layer,” Microsoft’s engineers wrote. “This allows having multiple, concurrent, independent data streams that do not affect each other.”

In addition, .NET 7 allows IT managers to observe more details of response calls for the WebSocket protocol when issues arise, such as handshake errors with a server. When a handshake succeeds or fails, information about the HTTP response headers and status codes can reveal critical information, such as the tokens associated with a session.