Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

set _requestQueueBoundHandle to null after disposing - #40466

Merged
stephentoub merged 3 commits into
dotnet:masterfrom
wfurt:restart_39552
Aug 26, 2019
Merged

set _requestQueueBoundHandle to null after disposing#40466
stephentoub merged 3 commits into
dotnet:masterfrom
wfurt:restart_39552

Conversation

@wfurt

@wfurt wfurt commented Aug 20, 2019

Copy link
Copy Markdown
Member

With this, Start()/Stop()/Start() sequence should work as expected.

Added two tests for restart.

fixes #39552

@wfurt
wfurt requested a review from a team August 20, 2019 21:17
@wfurt wfurt self-assigned this Aug 20, 2019
Comment thread src/System.Net.HttpListener/tests/SimpleHttpTests.cs Outdated
Comment thread src/System.Net.HttpListener/tests/SimpleHttpTests.cs Outdated
Comment thread src/System.Net.HttpListener/tests/SimpleHttpTests.cs Outdated
Comment thread src/System.Net.HttpListener/tests/SimpleHttpTests.cs Outdated

HttpListenerContext context = listener.GetContext();
HttpListenerResponse response = context.Response;
response.OutputStream.Write(System.Text.Encoding.UTF8.GetBytes(content));

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not using GetContextAsync() and WriteAsync()?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I could write one more variant. But for this test I wanted to cover the synchronous path. As far as the write, I don't think it matters. Since it is so small, it will go straight to socket buffer AFAIK without much .NET processing.

clientTask = client.GetStringAsync(factory.ListeningUrl);
context = listener.GetContext();
response = context.Response;
response.OutputStream.Write(System.Text.Encoding.UTF8.GetBytes(content));

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not using GetContextAsync() and WriteAsync()?

Comment thread src/System.Net.HttpListener/tests/SimpleHttpTests.cs Outdated
Comment thread src/System.Net.HttpListener/tests/SimpleHttpTests.cs Outdated
@davidsh davidsh added this to the 5.0 milestone Aug 24, 2019
@stephentoub
stephentoub merged commit 40949c4 into dotnet:master Aug 26, 2019
scalablecory added a commit that referenced this pull request Sep 3, 2019
scalablecory added a commit that referenced this pull request Sep 3, 2019
* Revert "set _requestQueueBoundHandle to null after disposing (#40466)", but keep tests around (disabled re: 39552)

This reverts commit 40949c4.
@wfurt
wfurt deleted the restart_39552 branch June 15, 2020 18:20
picenka21 pushed a commit to picenka21/runtime that referenced this pull request Feb 18, 2022
…0466)

* set _requestQueueBoundHandle to null after disposing

* remove extra spaces

* feedback from review


Commit migrated from dotnet/corefx@40949c4
picenka21 pushed a commit to picenka21/runtime that referenced this pull request Feb 18, 2022
…/corefx#40783)

* Revert "set _requestQueueBoundHandle to null after disposing (dotnet/corefx#40466)", but keep tests around (disabled re: 39552)

This reverts commit dotnet/corefx@40949c4.

Commit migrated from dotnet/corefx@7a668f4
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[HttpListener] HttpListener Start()/Stop()/Start()/BeginGetContext() causes ObjectDisposedException on Windows

4 participants