dotnet / dotnet/dotnet-api-docs

Misleading documentation about `Close` and `Abort`

Open
#880 0 comments 1 reaction 0 assignees View on GitHub
area-System.Net dotnet-api/prod Pri2 untriaged
Dominant language
C#
Stars
949
Forks
1.7k
Avg merge
3d 27m
Merged PRs (30d)
49

Description

The remarks for this class discuss Close and Abort as if they are operations that can be performed directly on the `HttpListenerContext`, but these are methods are instead declared on `HttpListenerResponse`.

It *appears* that the caller of `HttpListener.GetContext` (or one of its asynchronous variants) is responsible for calling one of `Dispose`/`Close`/`Abort` on the `Response` in order to ensure that system resources are freed appropriately, but this is not terribly clear from the documentation.

---
#### Document Details

⚠ *Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.*

* ID: 8d6db24e-a10b-c55c-e89c-0eb00da2b7dc
* Version Independent ID: fdb8413a-18d4-fdc2-85a7-322eb720f348
* Content: [HttpListenerContext Class (System.Net)](https://docs.microsoft.com/en-us/dotnet/api/system.net.httplistenercontext?view=netframework-4.7.2#feedback)
* Content Source: [xml/System.Net/HttpListenerContext.xml](https://github.com/dotnet/dotnet-api-docs/blob/master/xml/System.Net/HttpListenerContext.xml)
* Product: **dotnet-api**
* GitHub Login: @dotnet-bot
* Microsoft Alias: **dotnetcontent**

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.