Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[QUIC] API QuicConnection #71783

Merged
merged 23 commits into from
Jul 13, 2022
Merged

Conversation

ManickaP
Copy link
Member

@ManickaP ManickaP commented Jul 7, 2022

Fixes #68902
Contributes to #69675

This PR is based on #71579 so it shows more changes that it actually contains.

@dotnet-issue-labeler
Copy link

Note regarding the new-api-needs-documentation label:

This serves as a reminder for when your PR is modifying a ref *.cs file and adding/modifying public APIs, to please make sure the API implementation in the src *.cs file is documented with triple slash comments, so the PR reviewers can sign off that change.

@ghost ghost assigned ManickaP Jul 7, 2022
@ghost
Copy link

ghost commented Jul 7, 2022

Tagging subscribers to this area: @dotnet/ncl
See info in area-owners.md if you want to be subscribed.

Issue Details

Fixes #68902
Contributes to #69675

This PR is based on #71579 so it shows more changes that it actually contains.

Author: ManickaP
Assignees: -
Labels:

new-api-needs-documentation, area-System.Net.Quic

Milestone: -

@ManickaP ManickaP force-pushed the mapichov/quic-connection branch 4 times, most recently from 88ad8f3 to e02c32c Compare July 8, 2022 18:36
@ManickaP
Copy link
Member Author

This is fairly stable now, ready for review. Still letting it in draft due to unapproved API.
@CarnaViire @wfurt @rzikm if you could give it a look.

Also note that stream will be soon in PR as well.


internal static unsafe QuicAddr ToQuicAddr(this IPEndPoint iPEndPoint)
{
// TODO: is the layout same for SocketAddress.Buffer and QuicAddr on all platforms?
Copy link
Member

Choose a reason for hiding this comment

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

it should AFAIK. It would be nice to have some assert about it. It differs among platforms but MsQUIC now uses native layout e.g. same as SocketAddress.

Copy link
Member Author

Choose a reason for hiding this comment

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

authenticationOptions.ClientCertificates ?? new X509CertificateCollection(),
null,
Array.Empty<string>());
if (selectedCertificate.HasPrivateKey())
Copy link
Member

Choose a reason for hiding this comment

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

It would be nice to throw or at least log. I know this is what we we in SslStream for historical reasons but the failures when we silently ignore given certificate are annoying IMHO.
(this could be separate work)

Copy link
Member Author

Choose a reason for hiding this comment

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

@ManickaP ManickaP marked this pull request as ready for review July 12, 2022 19:57
@ManickaP
Copy link
Member Author

This is update based on the last version of API from #68902 (comment)
Main changes:

  • behavior of DisposeAsync (automatically will close with DefaultCloseErrorCode)
  • removed required from the options and replaced by explicit validation

@CarnaViire @wfurt @rzikm please give it look

Copy link
Member

@rzikm rzikm left a comment

Choose a reason for hiding this comment

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

LGTM, modulo comments.

@ManickaP
Copy link
Member Author

Failure is #71890, it's been closed in the meantime.

@ManickaP ManickaP merged commit d434c4a into dotnet:main Jul 13, 2022
@ManickaP ManickaP deleted the mapichov/quic-connection branch July 13, 2022 07:22
@ManickaP
Copy link
Member Author

/backport to release/7.0-preview7

@github-actions
Copy link
Contributor

Started backporting to release/7.0-preview7: https://github.com/dotnet/runtime/actions/runs/2664595774

@github-actions
Copy link
Contributor

@ManickaP backporting to release/7.0-preview7 failed, the patch most likely resulted in conflicts:

$ git am --3way --ignore-whitespace --keep-non-patch changes.patch

Applying: Listener comment; PreviewFeature attribute
Applying: Feedback
Applying: QuicConnection new API including compilable implementation
error: sha1 information is lacking or useless (src/libraries/System.Net.Quic/src/System/Net/Quic/QuicListener.cs).
error: could not build fake ancestor
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0003 QuicConnection new API including compilable implementation
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
Error: The process '/usr/bin/git' failed with exit code 128

Please backport manually!

ManickaP added a commit to ManickaP/runtime that referenced this pull request Jul 13, 2022
* Listener comment; PreviewFeature attribute

* Feedback

* QuicConnection new API including compilable implementation

* Fixed logging

* Fixed S.N.Quic and S.N.Http tests

* Options now correspond to the issue

* Feedback

* Comments, PreviewFeature attribute and RemoteCertificate disposal.

* Preview feature attribute is assembly wide

* Some typos

* Fixed test with certificate

* Default values as constants

* Event handlers split into methods called via switch expression.

* Some more comments

* Unified unsafe usage

* Fixed some more tests

* Cleaned up some exceptions and resource strings.

* Feedback

* Latest greatest API proposal.

* Fixed Http solution

* Feedback
@ManickaP
Copy link
Member Author

@JamesNK this will need your reaction as well. Note that the options classes were changed in the last API review and we removed the required keyword. If you hit any issues with this PR, let me know.

carlossanlop pushed a commit that referenced this pull request Jul 13, 2022
…72031) (#72106)

* [QUIC] API QuicConnection (#71783)

* Listener comment; PreviewFeature attribute

* Feedback

* QuicConnection new API including compilable implementation

* Fixed logging

* Fixed S.N.Quic and S.N.Http tests

* Options now correspond to the issue

* Feedback

* Comments, PreviewFeature attribute and RemoteCertificate disposal.

* Preview feature attribute is assembly wide

* Some typos

* Fixed test with certificate

* Default values as constants

* Event handlers split into methods called via switch expression.

* Some more comments

* Unified unsafe usage

* Fixed some more tests

* Cleaned up some exceptions and resource strings.

* Feedback

* Latest greatest API proposal.

* Fixed Http solution

* Feedback

* [QUIC] API QuicStream (#71969)

* Quic stream API surface

* Fixed test compilation

* Fixed http test compilation

* HttpLoopbackConnection Dispose -> DisposeAsync

* QuicStream implementation

* Fixed some tests

* Fixed all QUIC and HTTP tests

* Fixed exception type for stream closed by connection close

* Feedback

* Fixed WebSocket.Client test build

* Feedback, test fixes

* Fixed build on framework and windows

* Fixed winhandler test

* Swap variable based on order in defining class

* Post merge fixes

* Feedback and build

* Reverted connection state to pass around abort error code

* Fixed exception type.

* [QUIC] System.Net.Quic API made public (#72031)

* System.Net.Quic removed from ASP transport package and made part of SDK ref

* Removed manual references to System.Net.Quic.csproj
@karelz karelz added this to the 7.0.0 milestone Jul 19, 2022
@ghost ghost locked as resolved and limited conversation to collaborators Aug 18, 2022
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.

[API Proposal]: [QUIC] QuicConnection
5 participants