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

Port FullFx fix for SocketConnection sync/async timeout ignore problem. #3994

Conversation

StephenBonikowsky
Copy link
Member

@StephenBonikowsky
Copy link
Member Author

Going into master first then will cherry-pick to release/3.1.0.

@dasetser There is a fair amount of difference between the desktop and core versions of SocketConnection.cs so I had to port the changes manually and not all code paths were present.
Please review.

@mconnew
Copy link
Member

mconnew commented Oct 25, 2019

@StephenBonikowsky, the reason they are different is because I had to modify the implementation because of two reasons.

  1. Socket.Close(int timeout) wasn't originally available in .NET Core so I had to rewrite the close code to use socket lingering capabilities.
  2. Neither System.Net.Sockets or SslStream wasn't available for UWP so I had to rewrite everything on top of the UWP native classes for sockets which didn't have a 1:1 mapping of functionality so I refactored everything to a base class and the concrete implementation.

Neither of this problems exist today so my preference would be to replace the entire SocketConnection class with the implementation from .NET Framework as there are some compromises with the current implementation, e.g. close timeout only works with a granularity of 1 second.

@dasetser
Copy link
Contributor

@StephenBonikowsky It looks like you ported the fix correctly to the current implementation. However, I agree with Matt that it would be better if we could port the entire file over again if we can get rid of the compromises in the current implementation.

@StephenBonikowsky
Copy link
Member Author

Sounds good, I'll find Matt's commits and see if reverting them makes sense and then porting the SocketConnection class as it is in the full framework.

@StephenBonikowsky
Copy link
Member Author

This was not a straight forward port, no copy and paste and just fix formatting issues. There are quite a few things not present in Core that I had to account for. Particularly related to tracing.

Please review this carefully.

@mconnew
Copy link
Member

mconnew commented Oct 29, 2019

Just a couple of small issues around string resources, otherwise LGTM. Fix those SR.Format uses and we can call it good!

@StephenBonikowsky
Copy link
Member Author

The new tests added with #4000 are failing because the test server hasn't been updated. Will update it manually and then re-run the checks.

* There were still many changes that needed to be made to work in Core, too many to name, best just to do a diff.
* One big one was the absence of tracing code.
* Reoved SR.Format where not needed.
* Added back a comment that was useful.
* Use '_socket' instead of the in param 'socket' once '_socket = socket'
@mconnew
Copy link
Member

mconnew commented Oct 30, 2019

:shipit:

@StephenBonikowsky StephenBonikowsky merged commit 7627d8f into dotnet:master Oct 30, 2019
StephenBonikowsky added a commit to StephenBonikowsky/wcf that referenced this pull request Nov 4, 2019
…etconnectionfix

Port FullFx fix for SocketConnection sync/async timeout ignore problem.
@StephenBonikowsky StephenBonikowsky added the NET Core 3.1 Release Issues for the NET Core 3.1 release. label Jan 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NET Core 3.1 Release Issues for the NET Core 3.1 release.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants