Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 32 additions & 1 deletion xml/System.Net.Http/HttpCompletionOption.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,38 @@
</Base>
<Docs>
<summary>Indicates if <see cref="T:System.Net.Http.HttpClient" /> operations should be considered completed either as soon as a response is available, or after reading the entire response message including the content.</summary>
<remarks>To be added.</remarks>
<remarks>
<format type="text/markdown"><![CDATA[

## Remarks
<xref:System.Net.Http.HttpClient> is intended to be instantiated once and re-used throughout the life of an application. Instantiating an HttpClient class for every request will exhaust the number of sockets available under heavy loads. This will result in SocketException errors. Below is an example using HttpClient correctly.

```csharp
public class GoodController : ApiController
{
private static readonly HttpClient HttpClient;

static GoodController()
{
HttpClient = new HttpClient();
}
}
```

```vb
Public Class GoodController
Inherits ApiController

Private Shared ReadOnly HttpClient As HttpClient

Shared Sub New()
HttpClient = New HttpClient()
End Sub
End Class
```

]]></format>
</remarks>
</Docs>
<Members>
<Member MemberName="ResponseContentRead">
Expand Down