-
-
Notifications
You must be signed in to change notification settings - Fork 947
Start MessageListener with ThreadAbstraction.ExecuteThreadLongRunning #901
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
Conversation
@@ -36,16 +29,10 @@ public static void ExecuteThreadLongRunning(Action action) | |||
/// <param name="action">The action to execute.</param> | |||
public static void ExecuteThread(Action action) | |||
{ | |||
#if FEATURE_THREAD_THREADPOOL |
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'm afraid you'll need to revert these changes. ThreadPool is not available for UAP10.0 TFM (see https://github.com/sshnet/SSH.NET/wiki/Conditional-compilation-symbols for more information).
} | ||
|
||
public static void ExecuteThreadLongRunning(Action action) | ||
{ | ||
#if FEATURE_THREAD_TAP |
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 propose to leave this as is. Eventually, we'll need to change this as we need the thread or task that we started for our message listener in order to avoid thread leaks (there's an issue for this).
@@ -10,24 +10,17 @@ internal static class ThreadAbstraction | |||
/// <param name="millisecondsTimeout">The number of milliseconds for which the thread is suspended.</param> | |||
public static void Sleep(int millisecondsTimeout) | |||
{ | |||
#if FEATURE_THREAD_SLEEP |
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'm afraid you'll need to revert these changes. Thread.Sleep(...)
is not available for UAP10.0 TFM (see https://github.com/sshnet/SSH.NET/wiki/Conditional-compilation-symbols for more information).
Sorry, I've made an error to "Fetch upstream" from GitHub and it messed up the commit history. |
Changed the
Session.Connect
to useThreadAbstraction.ExecuteThreadLongRunning
to start theMessageListener
.The commit 5d173c8 also includes cleanup of
ThreadAbstraction
, which I did because I wasn't sure anymore which target was used as a dependency. I feel this cleanup is beneficial in the long run, but if you feel this is too much for this PR let me know and I'll roll it back.Fixes #824