---
title: "Discussion on \"Playing with HttpClient in .NET 4.8\" | Hashnode"
description: "Discussion on \"Playing with HttpClient in .NET 4.8\". Creating a new HttpClient instance for every request will exhaust the number of sockets available under heavy loads. This will result in SocketException errors.\nDon't use using statements. Because HttpClient instances should be long-lived. Disposing ..."
url: "https://hashnode.com/posts/best-practice-for-httpclient/645bca944771ea4b034b70c3"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Playing with HttpClient in .NET 4.8](https://karatas.dev/best-practice-for-httpclient?utm_source=hashnode&utm_medium=feed)

Creating a new HttpClient instance for every request will exhaust the number of sockets available under heavy loads. This will result in SocketException errors. Don't use using statements. Because HttpClient instances should be long-lived. Disposing ...

May 10, 2023 · 2 min read · karatas.dev  
Updated May 9, 2024  
Read the article

-   [#port-exhaustion](https://hashnode.com/tag/port-exhaustion)
-   [#httpclient](https://hashnode.com/tag/httpclient)
-   [#socket](https://hashnode.com/tag/socket)

## Written by

[Ferhat Karataş](https://hashnode.com/@karatas)

@karatas · Turkey

  
[View profile](https://hashnode.com/@karatas)

Software Developer

Performance freak

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
