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
Ported to .Net 3.5 #31
Conversation
Added projets and solutions for Net 3.5 and suffix them with Net35
added nugget package PortableTPL.dll
…lLibrary backport to .Net 3.5)
|
👍 |
|
@mcatanzariti this looks really awesome and finishes with the biggest problem Open.NAT has: too new .NET version. This comment is just to let you know I've seen the PR and i am going to review it and test it (what will take me several days). 👍 👍 👍 👍 |
Put back .Net 4.5 implementations that have been replace by .Net 3.5 implementations Fixed indentation
…lLibrary backport to .Net 3.5)
|
Reverted useless change in ISearcher … and I tried to rebase all my changes in one commit. |
|
You can use https://help.github.com/articles/about-git-rebase to squash the commits. |
| @@ -101,6 +101,24 @@ internal static string ToPrintableXml(this XmlDocument document) | |||
| } | |||
| } | |||
|
|
|||
| #if NET35 | |||
| public static Task<TResult> TimeoutAfter<TResult>(this Task<TResult> task, TimeSpan timeout) | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently this method always throws a TimeoutException when compiled in release mode (trying to use this with Unity). Is this pull request still alive?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will take a look. Thank you for the report!
|
@codan Has my fix resolved your problem in Unity? |
|
@lontivero Do you still plan to review this pull request? |
|
@mcatanzariti It appears to be working now. Thanks for the fix! |
|
@mcatanzariti yes, I still plan to review this pull request. I have been busy but I have this in my todo list. |
|
Just wanted to say that I'm using Open.NAT with this change included in a Unity plugin that I'm awaiting approval on now and so far everything has been working perfectly. Thanks @mcatanzariti and @lontivero |
|
@lontivero Good news :-D |
|
I didn't want to do it in this way because there are things that i wanted to do first:
Sadly I had no time to do that and many people need this PR so, i didn't want to keep it in a PR forever. |
I ported Open.Nat back to .Net 3.5 based on Microsoft official backport of the Task Parallel Library.
I introduced two precompilation symbols (NET35 and NET45)
I added projets and solutions for Net 3.5 and suffix them with Net35
I renamed existing projects and solutions to suffix them with Net45
Most of the work consisted in adding a .Net 3.5 version of async methods by replacing the await keywork by continuations tasks (Task.ContinueWith).
I also added a few extensions in Extensions.cs to emulate missing methods in .Net 3.5 or in the backported TPL:
The existing .Net 4.5 code should be unchanged.
Oh and I also tested Open.Nat 3.5 with Unity3d 5.2 and it seems to work perfectly!