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

fix #11309 in WebSockets by throwing when the underlying connection is closed - #11348

Merged
stephentoub merged 1 commit into
dotnet:masterfrom
analogrelay:anurse/11309-websocket-throw-on-closed-connection
Sep 2, 2016
Merged

fix #11309 in WebSockets by throwing when the underlying connection is closed#11348
stephentoub merged 1 commit into
dotnet:masterfrom
analogrelay:anurse/11309-websocket-throw-on-closed-connection

Conversation

@analogrelay

Copy link
Copy Markdown

/cc @stephentoub @Tratcher @moozzyk

Fixes #11309

The if clause is also no longer needed because the only way it could be triggered is if EnsureBufferContainsAsync completed successfully but hadn't read enough data (which only occurs when throwOnPrematureClosure is true).

analogrelay added a commit to aspnet/WebSockets that referenced this pull request Sep 1, 2016
@stephentoub

Copy link
Copy Markdown
Member

LGTM. Thanks, @anurse.

analogrelay added a commit to aspnet/WebSockets that referenced this pull request Sep 1, 2016
also adds some tests and extra features to the EchoApp test sample
analogrelay added a commit to aspnet/WebSockets that referenced this pull request Sep 1, 2016
also adds some tests and extra features to the EchoApp test sample
@analogrelay

analogrelay commented Sep 1, 2016

Copy link
Copy Markdown
Author

FYI, I do have a test for this in the aspnet copy (aspnet/WebSockets#114) but I don't think there's any infrastructure in this repo for testing actual socket-to-socket communications.

Not being 100% familiar with the merge policies in this repo, can I merge when the builds go green or do we need additional reviewers? Alternatively, I'm happy to let someone else handle the merge :P

@davidsh

davidsh commented Sep 1, 2016

Copy link
Copy Markdown
Contributor

Networking libraries (System.Net.*) are owned by the networking team.

You must add @CIPop @davidsh and @stephentoub to all networking PRs. We must sign off before any merge regardless of green.

We are also changing the testing requirements. We are moving a lot of tests to outerloop (see #11341). You must run outerloop as well.

@stephentoub

Copy link
Copy Markdown
Member

I don't think there's any infrastructure in this repo for testing actual socket-to-socket communications

There isn't... but how hard would that be to add? To use kestrel + websockets, are there NuGet packages we could pull into tests in order to host a local in-proc websocket server for a test? Alternatively, I'd been considering just writing a basic loopback websocket server that established the connection and then handed it off to the same ManagedWebSocket implementation. Hasn't been high on my priority list, though.

@stephentoub

Copy link
Copy Markdown
Member

@davidsh, the change LGTM, all tests passed, and your change hasn't gone in to move tests to outerloop... this can be merged, right?

@stephentoub

Copy link
Copy Markdown
Member

@anurse, just to confirm, you've verified this still passes 100% of the autobahn tests, right?

@CIPop

CIPop commented Sep 1, 2016

Copy link
Copy Markdown

I don't think there's any infrastructure in this repo for testing actual socket-to-socket communications.

@anurse @stephentoub @davidsh There actually is. Please try out https://github.com/dotnet/corefx/tree/master/src/Common/tests/System/Net/Prerequisites

@stephentoub

Copy link
Copy Markdown
Member

There actually is

Isn't that about standing up your own servers locally? I was referring to doing so in the tests in CI, such that I could write a test that spawned it's own websocket server, as we do for sockets and http and whatnot with loopback servers.

@analogrelay

Copy link
Copy Markdown
Author

@stephentoub Yes, this passes all Autobahn tests as well as specific unit tests in our repo, as shown by green status on aspnet/WebSockets#114 (comment)

@analogrelay

Copy link
Copy Markdown
Author

You must add @CIPop @davidsh and @stephentoub to all networking PRs. We must sign off before any merge regardless of green.

We are also changing the testing requirements. We are moving a lot of tests to outerloop (see #11341). You must run outerloop as well.

Good to know. It would be helpful if there was a breakdown somewhere in the Contributor's guide as to who owns what parts :). I'll investigate running the outerloop tests. Is that something done manually or triggered as part of the PR checks?

@CIPop

CIPop commented Sep 1, 2016

Copy link
Copy Markdown

Isn't that about standing up your own servers locally?

It does at this moment. We need to figure out how to get these activated in at least Outerloop testing (if not CI to replace the #11341 workaround).

@stephentoub
stephentoub merged commit 5aa3d2b into dotnet:master Sep 2, 2016
analogrelay added a commit to aspnet/WebSockets that referenced this pull request Sep 2, 2016
also adds some tests and extra features to the EchoApp test sample
Tratcher added a commit to aspnet/HttpSysServer that referenced this pull request Sep 2, 2016
Tratcher added a commit to aspnet/HttpSysServer that referenced this pull request Sep 2, 2016
@karelz karelz modified the milestone: 1.1.0 Dec 3, 2016
picenka21 pushed a commit to picenka21/runtime that referenced this pull request Feb 18, 2022
…cket-throw-on-closed-connection

fix dotnet/corefx#11309 in WebSockets by throwing when the underlying connection is closed

Commit migrated from dotnet/corefx@5aa3d2b
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.

7 participants