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

Added IConnectionSocketFeature for exposing underlying Socket! #30803

Closed
wants to merge 14 commits into from
Closed

Added IConnectionSocketFeature for exposing underlying Socket! #30803

wants to merge 14 commits into from

Conversation

ShreyasJejurkar
Copy link
Contributor

As part of #28401

@ghost ghost added the area-servers label Mar 10, 2021
@ShreyasJejurkar ShreyasJejurkar marked this pull request as ready for review March 11, 2021 04:58
@ShreyasJejurkar
Copy link
Contributor Author

Am yet to write tests, but am not able to find a file where it should be written! Waiting for some help on the same!

This reverts commit 8e73961.
@mkArtakMSFT mkArtakMSFT added the community-contribution Indicates that the PR has been added by a community member label Mar 11, 2021
@ShreyasJejurkar ShreyasJejurkar marked this pull request as draft March 12, 2021 14:27
Generated TransportConnection file using CodeGenerator
Added virutal socket again to SocketConnection.cs
Added virtual socket again to SocketConnection.cs
@ShreyasJejurkar ShreyasJejurkar marked this pull request as ready for review March 15, 2021 13:53
@ShreyasJejurkar
Copy link
Contributor Author

Should I merge the following two lines into one line?

@halter73
Copy link
Member

Am yet to write tests, but am not able to find a file where it should be written! Waiting for some help on the same!

There aren't any Socket-transport-specific functional tests yet since all functional tests live in the shared https://github.com/dotnet/aspnetcore/tree/main/src/Servers/Kestrel/test/FunctionalTests directory so they can be run against both the Socket and libuv transports. A shared test won't work for this since it relies on the connection having an underlying System.Net.Socket.

I think copying ConnectionClosedTokenFiresOnServerAbort into a new test class in https://github.com/dotnet/aspnetcore/tree/main/src/Servers/Kestrel/test/Sockets.FunctionalTests, but using context.Features.Get<IConnectionSocketFeature>().Socket!.Dispose() instead of context.Abort() might work.

@davidfowl davidfowl added the api-ready-for-review API is ready for formal API review - https://github.com/dotnet/apireviews label Mar 23, 2021
@ghost
Copy link

ghost commented Mar 23, 2021

Thank you for submitting this for API review. This will be reviewed by @dotnet/aspnet-api-review at the next meeting of the ASP.NET Core API Review group. Please ensure you take a look at the API review process documentation and ensure that:

  • The PR contains changes to the reference-assembly that describe the API change. Or, you have included a snippet of reference-assembly-style code that illustrates the API change.
  • The PR describes the impact to users, both positive (useful new APIs) and negative (breaking changes).
  • Someone is assigned to "champion" this change in the meeting, and they understand the impact and design of the change.

@davidfowl davidfowl added this to the 6.0-preview4 milestone Mar 29, 2021
@davidfowl
Copy link
Member

@MCCshreyas do you need anything to help finish this?

@ShreyasJejurkar
Copy link
Contributor Author

Hi, @davidfowl I have put this comment! Can you please check what needs to be done! @halter73 asked to remove virtual, but then I am not able to override it derive class!

#30803 (comment)

@ShreyasJejurkar
Copy link
Contributor Author

Only that thing is remaining from my point of view!

@halter73
Copy link
Member

halter73 commented Mar 31, 2021

I responded to the comment about the virtual.

We should add a test before merging, but I can take it from here since there's no similar test to really use as an example.

While I'm at it, I'll clean up the shared code generation and get this though API review before merging. Thanks for the PR!

@ShreyasJejurkar
Copy link
Contributor Author

ShreyasJejurkar commented Apr 3, 2021

Hi @halter73 sorry for later response. I will get that comment addressed. Last time I tried to follow your instructions about tests, but last time the code wasn't compiling because of that virtual error. If possible I will write test as well with upcoming commit.

@ShreyasJejurkar
Copy link
Contributor Author

There are some recent changes made in main branch, on how the code gets generated in TransportConnection.Generated.cs, am facing some issues while pulling the latest SDK, so I edited that file manually. I hope it's ok to do so!

@pranavkm pranavkm added api-approved API was approved in API review, it can be implemented and removed api-ready-for-review API is ready for formal API review - https://github.com/dotnet/apireviews labels Apr 5, 2021
@davidfowl davidfowl assigned davidfowl and unassigned halter73 Apr 7, 2021
@davidfowl
Copy link
Member

davidfowl commented Apr 7, 2021

Thanks for your hard work @MCCshreyas! There are a few changes we need to make here since we decided to make the Socket field non-nullable. I'd like to take over to make some changes to the code generator.

@davidfowl
Copy link
Member

Closed in favor of #31588. Kept your commits so you get credit! I'll likely squash them though.

@davidfowl davidfowl closed this Apr 7, 2021
@davidfowl davidfowl removed this from the 6.0-preview4 milestone Apr 7, 2021
@amcasey amcasey added area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions and removed area-runtime labels Jun 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api-approved API was approved in API review, it can be implemented area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions community-contribution Indicates that the PR has been added by a community member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants