瀏覽代碼

Revert "Clearify dynamic port forwarding."

This reverts commit 6c29387d5f3eeb8caf310fa3766fc7cb8568f63a.
drieseng 9 年之前
父節點
當前提交
64e375dc2d
共有 35 個文件被更改,包括 79 次插入716 次删除
  1. 0 8
      src/App2/App.xaml
  2. 0 106
      src/App2/App.xaml.cs
  3. 0 143
      src/App2/App2.csproj
  4. 二進制
      src/App2/App2_TemporaryKey.pfx
  5. 0 3
      src/App2/ApplicationInsights.config
  6. 二進制
      src/App2/Assets/LockScreenLogo.scale-200.png
  7. 二進制
      src/App2/Assets/SplashScreen.scale-200.png
  8. 二進制
      src/App2/Assets/Square150x150Logo.scale-200.png
  9. 二進制
      src/App2/Assets/Square44x44Logo.scale-200.png
  10. 二進制
      src/App2/Assets/Square44x44Logo.targetsize-24_altform-unplated.png
  11. 二進制
      src/App2/Assets/StoreLogo.png
  12. 二進制
      src/App2/Assets/Wide310x150Logo.scale-200.png
  13. 0 13
      src/App2/MainPage.xaml
  14. 0 30
      src/App2/MainPage.xaml.cs
  15. 0 49
      src/App2/Package.appxmanifest
  16. 0 29
      src/App2/Properties/AssemblyInfo.cs
  17. 0 31
      src/App2/Properties/Default.rd.xml
  18. 0 16
      src/App2/project.json
  19. 0 20
      src/ConsoleApp1/ConsoleApp1.xproj
  20. 0 14
      src/ConsoleApp1/Program.cs
  21. 0 23
      src/ConsoleApp1/Properties/AssemblyInfo.cs
  22. 0 32
      src/ConsoleApp1/project.json
  23. 2 2
      src/Renci.SshNet.NET35/Renci.SshNet.NET35.csproj
  24. 2 2
      src/Renci.SshNet.Silverlight5/Renci.SshNet.Silverlight5.csproj
  25. 8 8
      src/Renci.SshNet.UAP10/Renci.SshNet.UAP10.csproj
  26. 0 52
      src/Renci.SshNet.VS2015.sln
  27. 3 3
      src/Renci.SshNet.WindowsPhone8/Renci.SshNet.WindowsPhone8.csproj
  28. 4 8
      src/Renci.SshNet/Abstractions/DnsAbstraction.cs
  29. 4 6
      src/Renci.SshNet/Abstractions/ThreadAbstraction.cs
  30. 5 7
      src/Renci.SshNet/Common/SshDataStream.cs
  31. 1 2
      src/Renci.SshNet/ForwardedPortDynamic.cs
  32. 2 2
      src/Renci.SshNet/Renci.SshNet.csproj
  33. 2 4
      src/Renci.SshNet/Security/Cryptography/HashAlgorithmFactory.cs
  34. 42 98
      src/Renci.SshNet/Session.NET.cs
  35. 4 5
      src/Renci.SshNet/Shell.cs

+ 0 - 8
src/App2/App.xaml

@@ -1,8 +0,0 @@
-<Application
-    x:Class="App2.App"
-    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
-    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
-    xmlns:local="using:App2"
-    RequestedTheme="Light">
-
-</Application>

+ 0 - 106
src/App2/App.xaml.cs

@@ -1,106 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Linq;
-using System.Runtime.InteropServices.WindowsRuntime;
-using Windows.ApplicationModel;
-using Windows.ApplicationModel.Activation;
-using Windows.Foundation;
-using Windows.Foundation.Collections;
-using Windows.UI.Xaml;
-using Windows.UI.Xaml.Controls;
-using Windows.UI.Xaml.Controls.Primitives;
-using Windows.UI.Xaml.Data;
-using Windows.UI.Xaml.Input;
-using Windows.UI.Xaml.Media;
-using Windows.UI.Xaml.Navigation;
-
-namespace App2
-{
-    /// <summary>
-    /// Provides application-specific behavior to supplement the default Application class.
-    /// </summary>
-    sealed partial class App : Application
-    {
-        /// <summary>
-        /// Initializes the singleton application object.  This is the first line of authored code
-        /// executed, and as such is the logical equivalent of main() or WinMain().
-        /// </summary>
-        public App()
-        {
-            this.InitializeComponent();
-            this.Suspending += OnSuspending;
-        }
-
-        /// <summary>
-        /// Invoked when the application is launched normally by the end user.  Other entry points
-        /// will be used such as when the application is launched to open a specific file.
-        /// </summary>
-        /// <param name="e">Details about the launch request and process.</param>
-        protected override void OnLaunched(LaunchActivatedEventArgs e)
-        {
-#if DEBUG
-            if (System.Diagnostics.Debugger.IsAttached)
-            {
-                this.DebugSettings.EnableFrameRateCounter = true;
-            }
-#endif
-            Frame rootFrame = Window.Current.Content as Frame;
-
-            // Do not repeat app initialization when the Window already has content,
-            // just ensure that the window is active
-            if (rootFrame == null)
-            {
-                // Create a Frame to act as the navigation context and navigate to the first page
-                rootFrame = new Frame();
-
-                rootFrame.NavigationFailed += OnNavigationFailed;
-
-                if (e.PreviousExecutionState == ApplicationExecutionState.Terminated)
-                {
-                    //TODO: Load state from previously suspended application
-                }
-
-                // Place the frame in the current Window
-                Window.Current.Content = rootFrame;
-            }
-
-            if (e.PrelaunchActivated == false)
-            {
-                if (rootFrame.Content == null)
-                {
-                    // When the navigation stack isn't restored navigate to the first page,
-                    // configuring the new page by passing required information as a navigation
-                    // parameter
-                    rootFrame.Navigate(typeof(MainPage), e.Arguments);
-                }
-                // Ensure the current window is active
-                Window.Current.Activate();
-            }
-        }
-
-        /// <summary>
-        /// Invoked when Navigation to a certain page fails
-        /// </summary>
-        /// <param name="sender">The Frame which failed navigation</param>
-        /// <param name="e">Details about the navigation failure</param>
-        void OnNavigationFailed(object sender, NavigationFailedEventArgs e)
-        {
-            throw new Exception("Failed to load Page " + e.SourcePageType.FullName);
-        }
-
-        /// <summary>
-        /// Invoked when application execution is being suspended.  Application state is saved
-        /// without knowing whether the application will be terminated or resumed with the contents
-        /// of memory still intact.
-        /// </summary>
-        /// <param name="sender">The source of the suspend request.</param>
-        /// <param name="e">Details about the suspend request.</param>
-        private void OnSuspending(object sender, SuspendingEventArgs e)
-        {
-            var deferral = e.SuspendingOperation.GetDeferral();
-            //TODO: Save application state and stop any background activity
-            deferral.Complete();
-        }
-    }
-}

+ 0 - 143
src/App2/App2.csproj

@@ -1,143 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
-  <PropertyGroup>
-    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
-    <Platform Condition=" '$(Platform)' == '' ">x86</Platform>
-    <ProjectGuid>{33B54E09-865F-4717-8DC0-61284391DA56}</ProjectGuid>
-    <OutputType>AppContainerExe</OutputType>
-    <AppDesignerFolder>Properties</AppDesignerFolder>
-    <RootNamespace>App2</RootNamespace>
-    <AssemblyName>App2</AssemblyName>
-    <DefaultLanguage>en-US</DefaultLanguage>
-    <TargetPlatformIdentifier>UAP</TargetPlatformIdentifier>
-    <TargetPlatformVersion>10.0.10240.0</TargetPlatformVersion>
-    <TargetPlatformMinVersion>10.0.10240.0</TargetPlatformMinVersion>
-    <MinimumVisualStudioVersion>14</MinimumVisualStudioVersion>
-    <FileAlignment>512</FileAlignment>
-    <ProjectTypeGuids>{A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
-    <PackageCertificateKeyFile>App2_TemporaryKey.pfx</PackageCertificateKeyFile>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
-    <DebugSymbols>true</DebugSymbols>
-    <OutputPath>bin\x86\Debug\</OutputPath>
-    <DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
-    <NoWarn>;2008</NoWarn>
-    <DebugType>full</DebugType>
-    <PlatformTarget>x86</PlatformTarget>
-    <UseVSHostingProcess>false</UseVSHostingProcess>
-    <ErrorReport>prompt</ErrorReport>
-    <Prefer32Bit>true</Prefer32Bit>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
-    <OutputPath>bin\x86\Release\</OutputPath>
-    <DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
-    <Optimize>true</Optimize>
-    <NoWarn>;2008</NoWarn>
-    <DebugType>pdbonly</DebugType>
-    <PlatformTarget>x86</PlatformTarget>
-    <UseVSHostingProcess>false</UseVSHostingProcess>
-    <ErrorReport>prompt</ErrorReport>
-    <Prefer32Bit>true</Prefer32Bit>
-    <UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|ARM'">
-    <DebugSymbols>true</DebugSymbols>
-    <OutputPath>bin\ARM\Debug\</OutputPath>
-    <DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
-    <NoWarn>;2008</NoWarn>
-    <DebugType>full</DebugType>
-    <PlatformTarget>ARM</PlatformTarget>
-    <UseVSHostingProcess>false</UseVSHostingProcess>
-    <ErrorReport>prompt</ErrorReport>
-    <Prefer32Bit>true</Prefer32Bit>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|ARM'">
-    <OutputPath>bin\ARM\Release\</OutputPath>
-    <DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
-    <Optimize>true</Optimize>
-    <NoWarn>;2008</NoWarn>
-    <DebugType>pdbonly</DebugType>
-    <PlatformTarget>ARM</PlatformTarget>
-    <UseVSHostingProcess>false</UseVSHostingProcess>
-    <ErrorReport>prompt</ErrorReport>
-    <Prefer32Bit>true</Prefer32Bit>
-    <UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
-    <DebugSymbols>true</DebugSymbols>
-    <OutputPath>bin\x64\Debug\</OutputPath>
-    <DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
-    <NoWarn>;2008</NoWarn>
-    <DebugType>full</DebugType>
-    <PlatformTarget>x64</PlatformTarget>
-    <UseVSHostingProcess>false</UseVSHostingProcess>
-    <ErrorReport>prompt</ErrorReport>
-    <Prefer32Bit>true</Prefer32Bit>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
-    <OutputPath>bin\x64\Release\</OutputPath>
-    <DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
-    <Optimize>true</Optimize>
-    <NoWarn>;2008</NoWarn>
-    <DebugType>pdbonly</DebugType>
-    <PlatformTarget>x64</PlatformTarget>
-    <UseVSHostingProcess>false</UseVSHostingProcess>
-    <ErrorReport>prompt</ErrorReport>
-    <Prefer32Bit>true</Prefer32Bit>
-    <UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
-  </PropertyGroup>
-  <ItemGroup>
-    <!-- A reference to the entire .Net Framework and Windows SDK are automatically included -->
-    <Content Include="ApplicationInsights.config">
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </Content>
-    <None Include="project.json" />
-  </ItemGroup>
-  <ItemGroup>
-    <Compile Include="App.xaml.cs">
-      <DependentUpon>App.xaml</DependentUpon>
-    </Compile>
-    <Compile Include="MainPage.xaml.cs">
-      <DependentUpon>MainPage.xaml</DependentUpon>
-    </Compile>
-    <Compile Include="Properties\AssemblyInfo.cs" />
-  </ItemGroup>
-  <ItemGroup>
-    <AppxManifest Include="Package.appxmanifest">
-      <SubType>Designer</SubType>
-    </AppxManifest>
-    <None Include="App2_TemporaryKey.pfx" />
-  </ItemGroup>
-  <ItemGroup>
-    <Content Include="Properties\Default.rd.xml" />
-    <Content Include="Assets\LockScreenLogo.scale-200.png" />
-    <Content Include="Assets\SplashScreen.scale-200.png" />
-    <Content Include="Assets\Square150x150Logo.scale-200.png" />
-    <Content Include="Assets\Square44x44Logo.scale-200.png" />
-    <Content Include="Assets\Square44x44Logo.targetsize-24_altform-unplated.png" />
-    <Content Include="Assets\StoreLogo.png" />
-    <Content Include="Assets\Wide310x150Logo.scale-200.png" />
-  </ItemGroup>
-  <ItemGroup>
-    <ApplicationDefinition Include="App.xaml">
-      <Generator>MSBuild:Compile</Generator>
-      <SubType>Designer</SubType>
-    </ApplicationDefinition>
-    <Page Include="MainPage.xaml">
-      <Generator>MSBuild:Compile</Generator>
-      <SubType>Designer</SubType>
-    </Page>
-  </ItemGroup>
-  <PropertyGroup Condition=" '$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' &lt; '14.0' ">
-    <VisualStudioVersion>14.0</VisualStudioVersion>
-  </PropertyGroup>
-  <Import Project="$(MSBuildExtensionsPath)\Microsoft\WindowsXaml\v$(VisualStudioVersion)\Microsoft.Windows.UI.Xaml.CSharp.targets" />
-  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
-       Other similar extension points exist, see Microsoft.Common.targets.
-  <Target Name="BeforeBuild">
-  </Target>
-  <Target Name="AfterBuild">
-  </Target>
-  -->
-</Project>

二進制
src/App2/App2_TemporaryKey.pfx


+ 0 - 3
src/App2/ApplicationInsights.config

@@ -1,3 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<ApplicationInsights xmlns = "http://schemas.microsoft.com/ApplicationInsights/2013/Settings">
-</ApplicationInsights>

二進制
src/App2/Assets/LockScreenLogo.scale-200.png


二進制
src/App2/Assets/SplashScreen.scale-200.png


二進制
src/App2/Assets/Square150x150Logo.scale-200.png


二進制
src/App2/Assets/Square44x44Logo.scale-200.png


二進制
src/App2/Assets/Square44x44Logo.targetsize-24_altform-unplated.png


二進制
src/App2/Assets/StoreLogo.png


二進制
src/App2/Assets/Wide310x150Logo.scale-200.png


+ 0 - 13
src/App2/MainPage.xaml

@@ -1,13 +0,0 @@
-<Page
-    x:Class="App2.MainPage"
-    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
-    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
-    xmlns:local="using:App2"
-    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
-    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
-    mc:Ignorable="d">
-
-    <Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
-
-    </Grid>
-</Page>

+ 0 - 30
src/App2/MainPage.xaml.cs

@@ -1,30 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Linq;
-using System.Runtime.InteropServices.WindowsRuntime;
-using Windows.Foundation;
-using Windows.Foundation.Collections;
-using Windows.UI.Xaml;
-using Windows.UI.Xaml.Controls;
-using Windows.UI.Xaml.Controls.Primitives;
-using Windows.UI.Xaml.Data;
-using Windows.UI.Xaml.Input;
-using Windows.UI.Xaml.Media;
-using Windows.UI.Xaml.Navigation;
-
-// The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=402352&clcid=0x409
-
-namespace App2
-{
-    /// <summary>
-    /// An empty page that can be used on its own or navigated to within a Frame.
-    /// </summary>
-    public sealed partial class MainPage : Page
-    {
-        public MainPage()
-        {
-            this.InitializeComponent();
-        }
-    }
-}

+ 0 - 49
src/App2/Package.appxmanifest

@@ -1,49 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-
-<Package
-  xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10"
-  xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest"
-  xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10"
-  IgnorableNamespaces="uap mp">
-
-  <Identity
-    Name="3371af4c-bc30-40ea-ac93-975660d7f0a1"
-    Publisher="CN=Gert"
-    Version="1.0.0.0" />
-
-  <mp:PhoneIdentity PhoneProductId="3371af4c-bc30-40ea-ac93-975660d7f0a1" PhonePublisherId="00000000-0000-0000-0000-000000000000"/>
-
-  <Properties>
-    <DisplayName>App2</DisplayName>
-    <PublisherDisplayName>Gert</PublisherDisplayName>
-    <Logo>Assets\StoreLogo.png</Logo>
-  </Properties>
-
-  <Dependencies>
-    <TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.0.0" MaxVersionTested="10.0.0.0" />
-  </Dependencies>
-
-  <Resources>
-    <Resource Language="x-generate"/>
-  </Resources>
-
-  <Applications>
-    <Application Id="App"
-      Executable="$targetnametoken$.exe"
-      EntryPoint="App2.App">
-      <uap:VisualElements
-        DisplayName="App2"
-        Square150x150Logo="Assets\Square150x150Logo.png"
-        Square44x44Logo="Assets\Square44x44Logo.png"
-        Description="App2"
-        BackgroundColor="transparent">
-        <uap:DefaultTile Wide310x150Logo="Assets\Wide310x150Logo.png"/>
-        <uap:SplashScreen Image="Assets\SplashScreen.png" />
-      </uap:VisualElements>
-    </Application>
-  </Applications>
-
-  <Capabilities>
-    <Capability Name="internetClient" />
-  </Capabilities>
-</Package>

+ 0 - 29
src/App2/Properties/AssemblyInfo.cs

@@ -1,29 +0,0 @@
-using System.Reflection;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-
-// General Information about an assembly is controlled through the following 
-// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
-[assembly: AssemblyTitle("App2")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("App2")]
-[assembly: AssemblyCopyright("Copyright ©  2016")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-// Version information for an assembly consists of the following four values:
-//
-//      Major Version
-//      Minor Version 
-//      Build Number
-//      Revision
-//
-// You can specify all the values or you can default the Build and Revision Numbers 
-// by using the '*' as shown below:
-// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
-[assembly: ComVisible(false)]

+ 0 - 31
src/App2/Properties/Default.rd.xml

@@ -1,31 +0,0 @@
-<!--
-    This file contains Runtime Directives used by .NET Native. The defaults here are suitable for most
-    developers. However, you can modify these parameters to modify the behavior of the .NET Native
-    optimizer.
-
-    Runtime Directives are documented at http://go.microsoft.com/fwlink/?LinkID=391919
-
-    To fully enable reflection for App1.MyClass and all of its public/private members
-    <Type Name="App1.MyClass" Dynamic="Required All"/>
-
-    To enable dynamic creation of the specific instantiation of AppClass<T> over System.Int32
-    <TypeInstantiation Name="App1.AppClass" Arguments="System.Int32" Activate="Required Public" />
-
-    Using the Namespace directive to apply reflection policy to all the types in a particular namespace
-    <Namespace Name="DataClasses.ViewModels" Seralize="All" />
--->
-
-<Directives xmlns="http://schemas.microsoft.com/netfx/2013/01/metadata">
-  <Application>
-    <!--
-      An Assembly element with Name="*Application*" applies to all assemblies in
-      the application package. The asterisks are not wildcards.
-    -->
-    <Assembly Name="*Application*" Dynamic="Required All" />
-    
-    
-    <!-- Add your application specific runtime directives here. -->
-
-
-  </Application>
-</Directives>

+ 0 - 16
src/App2/project.json

@@ -1,16 +0,0 @@
-{
-  "dependencies": {
-    "Microsoft.NETCore.UniversalWindowsPlatform": "5.2.0-rc3-23931-00"
-  },
-  "frameworks": {
-    "uap10.0": {}
-  },
-  "runtimes": {
-    "win10-arm": {},
-    "win10-arm-aot": {},
-    "win10-x86": {},
-    "win10-x86-aot": {},
-    "win10-x64": {},
-    "win10-x64-aot": {}
-  }
-}

+ 0 - 20
src/ConsoleApp1/ConsoleApp1.xproj

@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <PropertyGroup>
-    <VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0</VisualStudioVersion>
-    <VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
-  </PropertyGroup>
-
-  <Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.Props" Condition="'$(VSToolsPath)' != ''" />
-  <PropertyGroup Label="Globals">
-    <ProjectGuid>93879798-7d2b-4550-8412-d492ee7172a8</ProjectGuid>
-    <RootNamespace>ConsoleApp1</RootNamespace>
-    <BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">..\artifacts\obj\$(MSBuildProjectName)</BaseIntermediateOutputPath>
-    <OutputPath Condition="'$(OutputPath)'=='' ">..\artifacts\bin\$(MSBuildProjectName)\</OutputPath>
-  </PropertyGroup>
-
-  <PropertyGroup>
-    <SchemaVersion>2.0</SchemaVersion>
-  </PropertyGroup>
-  <Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.targets" Condition="'$(VSToolsPath)' != ''" />
-</Project>

+ 0 - 14
src/ConsoleApp1/Program.cs

@@ -1,14 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Threading.Tasks;
-
-namespace ConsoleApp1
-{
-    public class Program
-    {
-        public static void Main(string[] args)
-        {
-        }
-    }
-}

+ 0 - 23
src/ConsoleApp1/Properties/AssemblyInfo.cs

@@ -1,23 +0,0 @@
-using System.Reflection;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-
-// General Information about an assembly is controlled through the following
-// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
-[assembly: AssemblyTitle("ConsoleApp1")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("ConsoleApp1")]
-[assembly: AssemblyCopyright("Copyright ©  2016")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-// Setting ComVisible to false makes the types in this assembly not visible
-// to COM components.  If you need to access a type in this assembly from
-// COM, set the ComVisible attribute to true on that type.
-[assembly: ComVisible(false)]
-
-// The following GUID is for the ID of the typelib if this project is exposed to COM
-[assembly: Guid("93879798-7d2b-4550-8412-d492ee7172a8")]

+ 0 - 32
src/ConsoleApp1/project.json

@@ -1,32 +0,0 @@
-{
-  "version": "1.0.0-*",
-  "description": "ConsoleApp1 Console Application",
-  "authors": [ "Gert" ],
-  "tags": [ "" ],
-  "projectUrl": "",
-  "licenseUrl": "",
-
-  "compilationOptions": {
-    "emitEntryPoint": true
-  },
-
-  "dependencies": {
-  },
-
-  "commands": {
-    "ConsoleApp1": "ConsoleApp1"
-  },
-
-  "frameworks": {
-    "dnx451": { },
-    "dnxcore50": {
-      "dependencies": {
-        "Microsoft.CSharp": "4.0.1-beta-23516",
-        "System.Collections": "4.0.11-beta-23516",
-        "System.Console": "4.0.0-beta-23516",
-        "System.Linq": "4.0.1-beta-23516",
-        "System.Threading": "4.0.11-beta-23516"
-      }
-    }
-  }
-}

+ 2 - 2
src/Renci.SshNet.NET35/Renci.SshNet.NET35.csproj

@@ -18,7 +18,7 @@
     <DebugType>full</DebugType>
     <DebugType>full</DebugType>
     <Optimize>false</Optimize>
     <Optimize>false</Optimize>
     <OutputPath>bin\Debug\</OutputPath>
     <OutputPath>bin\Debug\</OutputPath>
-    <DefineConstants>TRACE;DEBUG;TUNING;FEATURE_RNG_CSP;FEATURE_SOCKET_EAP;FEATURE_STREAM_APM;FEATURE_DNS_SYNC;FEATURE_THREAD_THREADPOOL;FEATURE_THREAD_SLEEP;FEATURE_HASH_MD5;FEATURE_HASH_SHA1;FEATURE_HASH_SHA256;FEATURE_HASH_SHA384;FEATURE_HASH_SHA512;FEATURE_HASH_RIPEMD160;FEATURE_HMAC_MD5;FEATURE_HMAC_SHA1;FEATURE_HMAC_SHA256;FEATURE_HMAC_SHA384;FEATURE_HMAC_SHA512;FEATURE_HMAC_RIPEMD160;FEATURE_MEMORYSTREAM_GETBUFFER</DefineConstants>
+    <DefineConstants>TRACE;DEBUG;TUNING;FEATURE_HASH_MD5;FEATURE_HASH_SHA1;FEATURE_HASH_SHA256;FEATURE_HASH_SHA384;FEATURE_HASH_SHA512;FEATURE_HASH_RIPEMD160;FEATURE_HMAC_MD5;FEATURE_HMAC_SHA1;FEATURE_HMAC_SHA256;FEATURE_HMAC_SHA384;FEATURE_HMAC_SHA512;FEATURE_HMAC_RIPEMD160;FEATURE_THREAD_SLEEP;FEATURE_MEMORYSTREAM_GETBUFFER</DefineConstants>
     <ErrorReport>prompt</ErrorReport>
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
     <WarningLevel>4</WarningLevel>
   </PropertyGroup>
   </PropertyGroup>
@@ -26,7 +26,7 @@
     <DebugType>none</DebugType>
     <DebugType>none</DebugType>
     <Optimize>true</Optimize>
     <Optimize>true</Optimize>
     <OutputPath>bin\Release\</OutputPath>
     <OutputPath>bin\Release\</OutputPath>
-    <DefineConstants>TRACE;TUNING;FEATURE_RNG_CSP;FEATURE_SOCKET_EAP;FEATURE_STREAM_APM;FEATURE_DNS_SYNC;FEATURE_THREAD_THREADPOOL;FEATURE_THREAD_SLEEP;FEATURE_HASH_MD5;FEATURE_HASH_SHA1;FEATURE_HASH_SHA256;FEATURE_HASH_SHA384;FEATURE_HASH_SHA512;FEATURE_HASH_RIPEMD160;FEATURE_HMAC_MD5;FEATURE_HMAC_SHA1;FEATURE_HMAC_SHA256;FEATURE_HMAC_SHA384;FEATURE_HMAC_SHA512;FEATURE_HMAC_RIPEMD160;FEATURE_MEMORYSTREAM_GETBUFFER</DefineConstants>
+    <DefineConstants>TRACE;TUNING;FEATURE_HASH_MD5;FEATURE_HASH_SHA1;FEATURE_HASH_SHA256;FEATURE_HASH_SHA384;FEATURE_HASH_SHA512;FEATURE_HASH_RIPEMD160;FEATURE_HMAC_MD5;FEATURE_HMAC_SHA1;FEATURE_HMAC_SHA256;FEATURE_HMAC_SHA384;FEATURE_HMAC_SHA512;FEATURE_HMAC_RIPEMD160</DefineConstants>
     <ErrorReport>prompt</ErrorReport>
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
     <WarningLevel>4</WarningLevel>
     <DocumentationFile>bin\Release\Renci.SshNet.xml</DocumentationFile>
     <DocumentationFile>bin\Release\Renci.SshNet.xml</DocumentationFile>

+ 2 - 2
src/Renci.SshNet.Silverlight5/Renci.SshNet.Silverlight5.csproj

@@ -29,7 +29,7 @@
     <DebugType>full</DebugType>
     <DebugType>full</DebugType>
     <Optimize>false</Optimize>
     <Optimize>false</Optimize>
     <OutputPath>Bin\Debug</OutputPath>
     <OutputPath>Bin\Debug</OutputPath>
-    <DefineConstants>TRACE;DEBUG;SILVERLIGHT;TUNING;FEATURE_RNG_CSP;FEATURE_SOCKET_EAP;FEATURE_DNS_SYNC;FEATURE_STREAM_APM;FEATURE_THREAD_THREADPOOL;FEATURE_THREAD_SLEEP;FEATURE_MEMORYSTREAM_GETBUFFER;FEATURE_HASH_SHA1;FEATURE_HASH_SHA256;FEATURE_HMAC_SHA1;FEATURE_HMAC_SHA256;</DefineConstants>
+    <DefineConstants>TRACE;DEBUG;SILVERLIGHT;TUNING;FEATURE_HASH_SHA1;FEATURE_HASH_SHA256;FEATURE_HMAC_SHA1;FEATURE_HMAC_SHA256;FEATURE_RNG_CRYPTO;FEATURE_THREAD_SLEEP;FEATURE_MEMORYSTREAM_GETBUFFER</DefineConstants>
     <NoStdLib>true</NoStdLib>
     <NoStdLib>true</NoStdLib>
     <NoConfig>true</NoConfig>
     <NoConfig>true</NoConfig>
     <ErrorReport>prompt</ErrorReport>
     <ErrorReport>prompt</ErrorReport>
@@ -41,7 +41,7 @@
     <DebugType>none</DebugType>
     <DebugType>none</DebugType>
     <Optimize>true</Optimize>
     <Optimize>true</Optimize>
     <OutputPath>Bin\Release</OutputPath>
     <OutputPath>Bin\Release</OutputPath>
-    <DefineConstants>TRACE;SILVERLIGHT;TUNING;FEATURE_RNG_CSP;FEATURE_SOCKET_EAP;FEATURE_DNS_SYNC;FEATURE_STREAM_APM;FEATURE_THREAD_THREADPOOL;FEATURE_THREAD_SLEEP;FEATURE_MEMORYSTREAM_GETBUFFER;FEATURE_HASH_SHA1;FEATURE_HASH_SHA256;FEATURE_HMAC_SHA1;FEATURE_HMAC_SHA256;</DefineConstants>
+    <DefineConstants>TRACE;SILVERLIGHT;TUNING;FEATURE_HASH_SHA1;FEATURE_HASH_SHA256;FEATURE_HMAC_SHA1;FEATURE_HMAC_SHA256</DefineConstants>
     <NoStdLib>true</NoStdLib>
     <NoStdLib>true</NoStdLib>
     <NoConfig>true</NoConfig>
     <NoConfig>true</NoConfig>
     <ErrorReport>prompt</ErrorReport>
     <ErrorReport>prompt</ErrorReport>

+ 8 - 8
src/Renci.SshNet.UAP10/Renci.SshNet.UAP10.csproj

@@ -23,7 +23,7 @@
     <DebugType>full</DebugType>
     <DebugType>full</DebugType>
     <Optimize>false</Optimize>
     <Optimize>false</Optimize>
     <OutputPath>bin\Debug\</OutputPath>
     <OutputPath>bin\Debug\</OutputPath>
-    <DefineConstants>TRACE;DEBUG;TUNING;FEATURE_RNG_CREATE;FEATURE_SOCKET_TAP;FEATURE_DNS_TAP;FEATURE_STREAM_TAP;FEATURE_THREAD_TAP;FEATURE_MEMORYSTREAM_TRYGETBUFFER;FEATURE_HASH_MD5;FEATURE_HMAC_MD5;FEATURE_HMAC_SHA1;FEATURE_HMAC_SHA256;FEATURE_HMAC_SHA384;FEATURE_HMAC_SHA512;FEATURE_REFLECTION_TYPEINFO</DefineConstants>
+    <DefineConstants>TRACE;DEBUG;TUNING;FEATURE_STREAM_ASYNC_TPL;FEATURE_SOCKET_EAP;FEATURE_DNS_ASYNC;FEATURE_TPL;FEATURE_SOCKET_TAP;FEATURE_REFLECTION_TYPEINFO</DefineConstants>
     <ErrorReport>prompt</ErrorReport>
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
     <WarningLevel>4</WarningLevel>
   </PropertyGroup>
   </PropertyGroup>
@@ -32,7 +32,7 @@
     <DebugType>pdbonly</DebugType>
     <DebugType>pdbonly</DebugType>
     <Optimize>true</Optimize>
     <Optimize>true</Optimize>
     <OutputPath>bin\Release\</OutputPath>
     <OutputPath>bin\Release\</OutputPath>
-    <DefineConstants>TRACE;TUNING;FEATURE_RNG_CREATE;FEATURE_SOCKET_TAP;FEATURE_DNS_TAP;FEATURE_STREAM_TAP;FEATURE_THREAD_TAP;FEATURE_MEMORYSTREAM_TRYGETBUFFER;FEATURE_HASH_MD5;FEATURE_HMAC_MD5;FEATURE_HMAC_SHA1;FEATURE_HMAC_SHA256;FEATURE_HMAC_SHA384;FEATURE_HMAC_SHA512;FEATURE_REFLECTION_TYPEINFO</DefineConstants>
+    <DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
     <ErrorReport>prompt</ErrorReport>
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
     <WarningLevel>4</WarningLevel>
   </PropertyGroup>
   </PropertyGroup>
@@ -40,7 +40,7 @@
     <PlatformTarget>x86</PlatformTarget>
     <PlatformTarget>x86</PlatformTarget>
     <DebugSymbols>true</DebugSymbols>
     <DebugSymbols>true</DebugSymbols>
     <OutputPath>bin\x86\Debug\</OutputPath>
     <OutputPath>bin\x86\Debug\</OutputPath>
-    <DefineConstants>TRACE;DEBUG;TUNING;FEATURE_RNG_CREATE;FEATURE_SOCKET_TAP;FEATURE_DNS_TAP;FEATURE_STREAM_TAP;FEATURE_THREAD_TAP;FEATURE_MEMORYSTREAM_TRYGETBUFFER;FEATURE_HASH_MD5;FEATURE_HMAC_MD5;FEATURE_HMAC_SHA1;FEATURE_HMAC_SHA256;FEATURE_HMAC_SHA384;FEATURE_HMAC_SHA512;FEATURE_REFLECTION_TYPEINFO</DefineConstants>
+    <DefineConstants>TRACE;DEBUG;TUNING;FEATURE_STREAM_ASYNC_TPL;FEATURE_SOCKET_EAP</DefineConstants>
     <NoWarn>;2008</NoWarn>
     <NoWarn>;2008</NoWarn>
     <DebugType>full</DebugType>
     <DebugType>full</DebugType>
     <PlatformTarget>AnyCPU</PlatformTarget>
     <PlatformTarget>AnyCPU</PlatformTarget>
@@ -50,7 +50,7 @@
   <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
   <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
     <PlatformTarget>x86</PlatformTarget>
     <PlatformTarget>x86</PlatformTarget>
     <OutputPath>bin\x86\Release\</OutputPath>
     <OutputPath>bin\x86\Release\</OutputPath>
-    <DefineConstants>TRACE;TUNING;FEATURE_RNG_CREATE;FEATURE_SOCKET_TAP;FEATURE_DNS_TAP;FEATURE_STREAM_TAP;FEATURE_THREAD_TAP;FEATURE_MEMORYSTREAM_TRYGETBUFFER;FEATURE_HASH_MD5;FEATURE_HMAC_MD5;FEATURE_HMAC_SHA1;FEATURE_HMAC_SHA256;FEATURE_HMAC_SHA384;FEATURE_HMAC_SHA512;FEATURE_REFLECTION_TYPEINFO</DefineConstants>
+    <DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
     <Optimize>true</Optimize>
     <Optimize>true</Optimize>
     <NoWarn>;2008</NoWarn>
     <NoWarn>;2008</NoWarn>
     <DebugType>pdbonly</DebugType>
     <DebugType>pdbonly</DebugType>
@@ -62,7 +62,7 @@
     <PlatformTarget>ARM</PlatformTarget>
     <PlatformTarget>ARM</PlatformTarget>
     <DebugSymbols>true</DebugSymbols>
     <DebugSymbols>true</DebugSymbols>
     <OutputPath>bin\ARM\Debug\</OutputPath>
     <OutputPath>bin\ARM\Debug\</OutputPath>
-    <DefineConstants>TRACE;DEBUG;TUNING;FEATURE_RNG_CREATE;FEATURE_SOCKET_TAP;FEATURE_DNS_TAP;FEATURE_STREAM_TAP;FEATURE_THREAD_TAP;FEATURE_MEMORYSTREAM_TRYGETBUFFER;FEATURE_HASH_MD5;FEATURE_HMAC_MD5;FEATURE_HMAC_SHA1;FEATURE_HMAC_SHA256;FEATURE_HMAC_SHA384;FEATURE_HMAC_SHA512;FEATURE_REFLECTION_TYPEINFO</DefineConstants>
+    <DefineConstants>TRACE;DEBUG;TUNING;FEATURE_STREAM_ASYNC_TPL;FEATURE_SOCKET_EAP;FEATURE_SOCKET_TAP;FEATURE_TPL;FEATURE_DNS_ASYNC;FEATURE_REFLECTION_TYPEINFO</DefineConstants>
     <NoWarn>;2008</NoWarn>
     <NoWarn>;2008</NoWarn>
     <DebugType>full</DebugType>
     <DebugType>full</DebugType>
     <PlatformTarget>ARM</PlatformTarget>
     <PlatformTarget>ARM</PlatformTarget>
@@ -72,7 +72,7 @@
   <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|ARM'">
   <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|ARM'">
     <PlatformTarget>ARM</PlatformTarget>
     <PlatformTarget>ARM</PlatformTarget>
     <OutputPath>bin\ARM\Release\</OutputPath>
     <OutputPath>bin\ARM\Release\</OutputPath>
-    <DefineConstants>TRACE;TUNING;FEATURE_RNG_CREATE;FEATURE_SOCKET_TAP;FEATURE_DNS_TAP;FEATURE_STREAM_TAP;FEATURE_THREAD_TAP;FEATURE_MEMORYSTREAM_TRYGETBUFFER;FEATURE_HASH_MD5;FEATURE_HMAC_MD5;FEATURE_HMAC_SHA1;FEATURE_HMAC_SHA256;FEATURE_HMAC_SHA384;FEATURE_HMAC_SHA512;FEATURE_REFLECTION_TYPEINFO</DefineConstants>
+    <DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
     <Optimize>true</Optimize>
     <Optimize>true</Optimize>
     <NoWarn>;2008</NoWarn>
     <NoWarn>;2008</NoWarn>
     <DebugType>pdbonly</DebugType>
     <DebugType>pdbonly</DebugType>
@@ -84,7 +84,7 @@
     <PlatformTarget>x64</PlatformTarget>
     <PlatformTarget>x64</PlatformTarget>
     <DebugSymbols>true</DebugSymbols>
     <DebugSymbols>true</DebugSymbols>
     <OutputPath>bin\x64\Debug\</OutputPath>
     <OutputPath>bin\x64\Debug\</OutputPath>
-    <DefineConstants>TRACE;DEBUG;TUNING;FEATURE_RNG_CREATE;FEATURE_SOCKET_TAP;FEATURE_DNS_TAP;FEATURE_STREAM_TAP;FEATURE_THREAD_TAP;FEATURE_MEMORYSTREAM_TRYGETBUFFER;FEATURE_HASH_MD5;FEATURE_HMAC_MD5;FEATURE_HMAC_SHA1;FEATURE_HMAC_SHA256;FEATURE_HMAC_SHA384;FEATURE_HMAC_SHA512;FEATURE_REFLECTION_TYPEINFO</DefineConstants>
+    <DefineConstants>TRACE;DEBUG;TUNING;FEATURE_STREAM_ASYNC_TPL;FEATURE_SOCKET_EAP</DefineConstants>
     <NoWarn>;2008</NoWarn>
     <NoWarn>;2008</NoWarn>
     <DebugType>full</DebugType>
     <DebugType>full</DebugType>
     <PlatformTarget>x64</PlatformTarget>
     <PlatformTarget>x64</PlatformTarget>
@@ -94,7 +94,7 @@
   <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
   <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
     <PlatformTarget>x64</PlatformTarget>
     <PlatformTarget>x64</PlatformTarget>
     <OutputPath>bin\x64\Release\</OutputPath>
     <OutputPath>bin\x64\Release\</OutputPath>
-    <DefineConstants>TRACE;TUNING;FEATURE_RNG_CREATE;FEATURE_SOCKET_TAP;FEATURE_DNS_TAP;FEATURE_STREAM_TAP;FEATURE_THREAD_TAP;FEATURE_MEMORYSTREAM_TRYGETBUFFER;FEATURE_HASH_MD5;FEATURE_HMAC_MD5;FEATURE_HMAC_SHA1;FEATURE_HMAC_SHA256;FEATURE_HMAC_SHA384;FEATURE_HMAC_SHA512;FEATURE_REFLECTION_TYPEINFO</DefineConstants>
+    <DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
     <Optimize>true</Optimize>
     <Optimize>true</Optimize>
     <NoWarn>;2008</NoWarn>
     <NoWarn>;2008</NoWarn>
     <DebugType>pdbonly</DebugType>
     <DebugType>pdbonly</DebugType>

+ 0 - 52
src/Renci.SshNet.VS2015.sln

@@ -53,10 +53,6 @@ Project("{911E67C6-3D85-4FCE-B560-20A9C3E3FF48}") = "nuget", "Build\nuget\nuget.
 EndProject
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Renci.SshNet.UAP10", "Renci.SshNet.UAP10\Renci.SshNet.UAP10.csproj", "{EC212E04-A372-4B95-B45B-C0D4A739EF80}"
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Renci.SshNet.UAP10", "Renci.SshNet.UAP10\Renci.SshNet.UAP10.csproj", "{EC212E04-A372-4B95-B45B-C0D4A739EF80}"
 EndProject
 EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "App2", "App2\App2.csproj", "{33B54E09-865F-4717-8DC0-61284391DA56}"
-EndProject
-Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "ConsoleApp1", "ConsoleApp1\ConsoleApp1.xproj", "{93879798-7D2B-4550-8412-D492EE7172A8}"
-EndProject
 Global
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 		Debug|Any CPU = Debug|Any CPU
 		Debug|Any CPU = Debug|Any CPU
@@ -185,54 +181,6 @@ Global
 		{EC212E04-A372-4B95-B45B-C0D4A739EF80}.Release|x64.Build.0 = Release|x64
 		{EC212E04-A372-4B95-B45B-C0D4A739EF80}.Release|x64.Build.0 = Release|x64
 		{EC212E04-A372-4B95-B45B-C0D4A739EF80}.Release|x86.ActiveCfg = Release|x86
 		{EC212E04-A372-4B95-B45B-C0D4A739EF80}.Release|x86.ActiveCfg = Release|x86
 		{EC212E04-A372-4B95-B45B-C0D4A739EF80}.Release|x86.Build.0 = Release|x86
 		{EC212E04-A372-4B95-B45B-C0D4A739EF80}.Release|x86.Build.0 = Release|x86
-		{33B54E09-865F-4717-8DC0-61284391DA56}.Debug|Any CPU.ActiveCfg = Debug|ARM
-		{33B54E09-865F-4717-8DC0-61284391DA56}.Debug|Any CPU.Build.0 = Debug|ARM
-		{33B54E09-865F-4717-8DC0-61284391DA56}.Debug|Any CPU.Deploy.0 = Debug|ARM
-		{33B54E09-865F-4717-8DC0-61284391DA56}.Debug|ARM.ActiveCfg = Debug|ARM
-		{33B54E09-865F-4717-8DC0-61284391DA56}.Debug|ARM.Build.0 = Debug|ARM
-		{33B54E09-865F-4717-8DC0-61284391DA56}.Debug|ARM.Deploy.0 = Debug|ARM
-		{33B54E09-865F-4717-8DC0-61284391DA56}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
-		{33B54E09-865F-4717-8DC0-61284391DA56}.Debug|Mixed Platforms.Build.0 = Debug|x86
-		{33B54E09-865F-4717-8DC0-61284391DA56}.Debug|Mixed Platforms.Deploy.0 = Debug|x86
-		{33B54E09-865F-4717-8DC0-61284391DA56}.Debug|x64.ActiveCfg = Debug|x64
-		{33B54E09-865F-4717-8DC0-61284391DA56}.Debug|x64.Build.0 = Debug|x64
-		{33B54E09-865F-4717-8DC0-61284391DA56}.Debug|x64.Deploy.0 = Debug|x64
-		{33B54E09-865F-4717-8DC0-61284391DA56}.Debug|x86.ActiveCfg = Debug|x86
-		{33B54E09-865F-4717-8DC0-61284391DA56}.Debug|x86.Build.0 = Debug|x86
-		{33B54E09-865F-4717-8DC0-61284391DA56}.Debug|x86.Deploy.0 = Debug|x86
-		{33B54E09-865F-4717-8DC0-61284391DA56}.Release|Any CPU.ActiveCfg = Release|x86
-		{33B54E09-865F-4717-8DC0-61284391DA56}.Release|ARM.ActiveCfg = Release|ARM
-		{33B54E09-865F-4717-8DC0-61284391DA56}.Release|ARM.Build.0 = Release|ARM
-		{33B54E09-865F-4717-8DC0-61284391DA56}.Release|ARM.Deploy.0 = Release|ARM
-		{33B54E09-865F-4717-8DC0-61284391DA56}.Release|Mixed Platforms.ActiveCfg = Release|x86
-		{33B54E09-865F-4717-8DC0-61284391DA56}.Release|Mixed Platforms.Build.0 = Release|x86
-		{33B54E09-865F-4717-8DC0-61284391DA56}.Release|Mixed Platforms.Deploy.0 = Release|x86
-		{33B54E09-865F-4717-8DC0-61284391DA56}.Release|x64.ActiveCfg = Release|x64
-		{33B54E09-865F-4717-8DC0-61284391DA56}.Release|x64.Build.0 = Release|x64
-		{33B54E09-865F-4717-8DC0-61284391DA56}.Release|x64.Deploy.0 = Release|x64
-		{33B54E09-865F-4717-8DC0-61284391DA56}.Release|x86.ActiveCfg = Release|x86
-		{33B54E09-865F-4717-8DC0-61284391DA56}.Release|x86.Build.0 = Release|x86
-		{33B54E09-865F-4717-8DC0-61284391DA56}.Release|x86.Deploy.0 = Release|x86
-		{93879798-7D2B-4550-8412-D492EE7172A8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
-		{93879798-7D2B-4550-8412-D492EE7172A8}.Debug|Any CPU.Build.0 = Debug|Any CPU
-		{93879798-7D2B-4550-8412-D492EE7172A8}.Debug|ARM.ActiveCfg = Debug|Any CPU
-		{93879798-7D2B-4550-8412-D492EE7172A8}.Debug|ARM.Build.0 = Debug|Any CPU
-		{93879798-7D2B-4550-8412-D492EE7172A8}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
-		{93879798-7D2B-4550-8412-D492EE7172A8}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
-		{93879798-7D2B-4550-8412-D492EE7172A8}.Debug|x64.ActiveCfg = Debug|Any CPU
-		{93879798-7D2B-4550-8412-D492EE7172A8}.Debug|x64.Build.0 = Debug|Any CPU
-		{93879798-7D2B-4550-8412-D492EE7172A8}.Debug|x86.ActiveCfg = Debug|Any CPU
-		{93879798-7D2B-4550-8412-D492EE7172A8}.Debug|x86.Build.0 = Debug|Any CPU
-		{93879798-7D2B-4550-8412-D492EE7172A8}.Release|Any CPU.ActiveCfg = Release|Any CPU
-		{93879798-7D2B-4550-8412-D492EE7172A8}.Release|Any CPU.Build.0 = Release|Any CPU
-		{93879798-7D2B-4550-8412-D492EE7172A8}.Release|ARM.ActiveCfg = Release|Any CPU
-		{93879798-7D2B-4550-8412-D492EE7172A8}.Release|ARM.Build.0 = Release|Any CPU
-		{93879798-7D2B-4550-8412-D492EE7172A8}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
-		{93879798-7D2B-4550-8412-D492EE7172A8}.Release|Mixed Platforms.Build.0 = Release|Any CPU
-		{93879798-7D2B-4550-8412-D492EE7172A8}.Release|x64.ActiveCfg = Release|Any CPU
-		{93879798-7D2B-4550-8412-D492EE7172A8}.Release|x64.Build.0 = Release|Any CPU
-		{93879798-7D2B-4550-8412-D492EE7172A8}.Release|x86.ActiveCfg = Release|Any CPU
-		{93879798-7D2B-4550-8412-D492EE7172A8}.Release|x86.Build.0 = Release|Any CPU
 	EndGlobalSection
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE
 		HideSolutionNode = FALSE

+ 3 - 3
src/Renci.SshNet.WindowsPhone8/Renci.SshNet.WindowsPhone8.csproj

@@ -23,7 +23,7 @@
     <DebugType>full</DebugType>
     <DebugType>full</DebugType>
     <Optimize>false</Optimize>
     <Optimize>false</Optimize>
     <OutputPath>Bin\Debug</OutputPath>
     <OutputPath>Bin\Debug</OutputPath>
-    <DefineConstants>TRACE;DEBUG;SILVERLIGHT;WINDOWS_PHONE;TUNING;FEATURE_RNG_CSP;FEATURE_SOCKET_EAP;FEATURE_DNS_SYNC;FEATURE_STREAM_APM;FEATURE_THREAD_THREADPOOL;FEATURE_THREAD_SLEEP;FEATURE_MEMORYSTREAM_GETBUFFER;FEATURE_HASH_SHA1;FEATURE_HASH_SHA256;FEATURE_HMAC_SHA1;FEATURE_HMAC_SHA256;</DefineConstants>
+    <DefineConstants>TRACE;DEBUG;SILVERLIGHT;WINDOWS_PHONE;TUNING;FEATURE_HASH_SHA1;FEATURE_HASH_SHA256;FEATURE_HMAC_SHA1;FEATURE_HMAC_SHA256;FEATURE_RNG_CRYPTO;FEATURE_THREAD_SLEEP;FEATURE_MEMORYSTREAM_GETBUFFER</DefineConstants>
     <NoStdLib>true</NoStdLib>
     <NoStdLib>true</NoStdLib>
     <NoConfig>true</NoConfig>
     <NoConfig>true</NoConfig>
     <ErrorReport>prompt</ErrorReport>
     <ErrorReport>prompt</ErrorReport>
@@ -35,7 +35,7 @@
     <DebugType>none</DebugType>
     <DebugType>none</DebugType>
     <Optimize>true</Optimize>
     <Optimize>true</Optimize>
     <OutputPath>Bin\Release</OutputPath>
     <OutputPath>Bin\Release</OutputPath>
-    <DefineConstants>TRACE;SILVERLIGHT;WINDOWS_PHONE;TUNING;FEATURE_RNG_CSP;FEATURE_SOCKET_EAP;FEATURE_DNS_SYNC;FEATURE_STREAM_APM;FEATURE_THREAD_THREADPOOL;FEATURE_THREAD_SLEEP;FEATURE_MEMORYSTREAM_GETBUFFER;FEATURE_HASH_SHA1;FEATURE_HASH_SHA256;FEATURE_HMAC_SHA1;FEATURE_HMAC_SHA256;</DefineConstants>
+    <DefineConstants>TRACE;SILVERLIGHT;WINDOWS_PHONE;TUNING;FEATURE_HASH_SHA1;FEATURE_HASH_SHA256;FEATURE_HMAC_SHA1;FEATURE_HMAC_SHA256</DefineConstants>
     <NoStdLib>true</NoStdLib>
     <NoStdLib>true</NoStdLib>
     <NoConfig>true</NoConfig>
     <NoConfig>true</NoConfig>
     <ErrorReport>prompt</ErrorReport>
     <ErrorReport>prompt</ErrorReport>
@@ -924,7 +924,7 @@
   <Import Project="$(MSBuildExtensionsPath)\Microsoft\$(TargetFrameworkIdentifier)\$(TargetFrameworkVersion)\Microsoft.$(TargetFrameworkIdentifier).CSharp.targets" />
   <Import Project="$(MSBuildExtensionsPath)\Microsoft\$(TargetFrameworkIdentifier)\$(TargetFrameworkVersion)\Microsoft.$(TargetFrameworkIdentifier).CSharp.targets" />
   <ProjectExtensions>
   <ProjectExtensions>
     <VisualStudio>
     <VisualStudio>
-      <UserProperties ProjectLinkerExcludeFilter="\\?desktop(\\.*)?$;\\?silverlight(\\.*)?$;\.desktop;\.silverlight;\.xaml;^service references(\\.*)?$;\.clientconfig;^web references(\\.*)?$" ProjectLinkReference="2f5f8c90-0bd1-424f-997c-7bc6280919d1" />
+      <UserProperties ProjectLinkReference="2f5f8c90-0bd1-424f-997c-7bc6280919d1" ProjectLinkerExcludeFilter="\\?desktop(\\.*)?$;\\?silverlight(\\.*)?$;\.desktop;\.silverlight;\.xaml;^service references(\\.*)?$;\.clientconfig;^web references(\\.*)?$" />
     </VisualStudio>
     </VisualStudio>
   </ProjectExtensions>
   </ProjectExtensions>
   <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
   <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 

+ 4 - 8
src/Renci.SshNet/Abstractions/DnsAbstraction.cs

@@ -14,12 +14,10 @@ namespace Renci.SshNet.Abstractions
         /// </returns>
         /// </returns>
         public static IPAddress[] GetHostAddresses(string hostNameOrAddress)
         public static IPAddress[] GetHostAddresses(string hostNameOrAddress)
         {
         {
-#if FEATURE_DNS_SYNC
-            return Dns.GetHostAddresses(hostNameOrAddress);
-#elif FEATURE_DNS_TAP
+#if FEATURE_DNS_ASYNC
             return Dns.GetHostAddressesAsync(hostNameOrAddress).Result;
             return Dns.GetHostAddressesAsync(hostNameOrAddress).Result;
 #else
 #else
-            #error Retrieving IP addresses for a given host is not implemented.
+            return Dns.GetHostAddresses(hostNameOrAddress);
 #endif
 #endif
         }
         }
 
 
@@ -33,12 +31,10 @@ namespace Renci.SshNet.Abstractions
         /// </returns>
         /// </returns>
         public static IPHostEntry GetHostEntry(string hostNameOrAddress)
         public static IPHostEntry GetHostEntry(string hostNameOrAddress)
         {
         {
-#if FEATURE_DNS_SYNC
-            return Dns.GetHostEntry(hostNameOrAddress);
-#elif FEATURE_DNS_TAP
+#if FEATURE_DNS_ASYNC
             return Dns.GetHostEntryAsync(hostNameOrAddress).Result;
             return Dns.GetHostEntryAsync(hostNameOrAddress).Result;
 #else
 #else
-            #error Resolving host name or IP address to an IPHostEntry is not implemented.
+            return Dns.GetHostEntry(hostNameOrAddress);
 #endif
 #endif
         }
         }
     }
     }

+ 4 - 6
src/Renci.SshNet/Abstractions/ThreadAbstraction.cs

@@ -12,10 +12,10 @@ namespace Renci.SshNet.Abstractions
         {
         {
 #if FEATURE_THREAD_SLEEP
 #if FEATURE_THREAD_SLEEP
             System.Threading.Thread.Sleep(millisecondsTimeout);
             System.Threading.Thread.Sleep(millisecondsTimeout);
-#elif FEATURE_THREAD_TAP
+#elif FEATURE_TPL
             System.Threading.Tasks.Task.Delay(millisecondsTimeout).Wait();
             System.Threading.Tasks.Task.Delay(millisecondsTimeout).Wait();
 #else
 #else
-            #error Suspend of the current thread is not implemented.
+#error Suspend of the current thread is not implemented.
 #endif
 #endif
         }
         }
 
 
@@ -25,12 +25,10 @@ namespace Renci.SshNet.Abstractions
         /// <param name="action">The action to execute.</param>
         /// <param name="action">The action to execute.</param>
         public static void ExecuteThread(Action action)
         public static void ExecuteThread(Action action)
         {
         {
-#if FEATURE_THREAD_THREADPOOL
-            System.Threading.ThreadPool.QueueUserWorkItem(o => action());
-#elif FEATURE_THREAD_TAP
+#if FEATURE_TPL
             System.Threading.Tasks.Task.Run(action);
             System.Threading.Tasks.Task.Run(action);
 #else
 #else
-            #error Execution of action in a separate thread is not implemented.
+            System.Threading.ThreadPool.QueueUserWorkItem(o => action());
 #endif
 #endif
         }
         }
     }
     }

+ 5 - 7
src/Renci.SshNet/Common/SshDataStream.cs

@@ -202,7 +202,7 @@ namespace Renci.SshNet.Common
         private byte[] ReadBytes(int length)
         private byte[] ReadBytes(int length)
         {
         {
             var data = new byte[length];
             var data = new byte[length];
-            var bytesRead = Read(data, 0, length);
+            var bytesRead = base.Read(data, 0, length);
 
 
             if (bytesRead < length)
             if (bytesRead < length)
                 throw new ArgumentOutOfRangeException("length");
                 throw new ArgumentOutOfRangeException("length");
@@ -214,19 +214,17 @@ namespace Renci.SshNet.Common
         /// Writes the stream contents to a byte array, regardless of the <see cref="MemoryStream.Position"/>.
         /// Writes the stream contents to a byte array, regardless of the <see cref="MemoryStream.Position"/>.
         /// </summary>
         /// </summary>
         /// <returns>
         /// <returns>
-        /// This method returns the contents of the <see cref="SshDataStream"/> as a byte array.
+        /// This method returns a copy of the contents of the <see cref="SshDataStream"/> as a byte array.
+        /// If the current instance was constructed on a provided byte array, a copy of the section of the array to which this instance has access is returned.
+        /// TODO
         /// </returns>
         /// </returns>
-        /// <remarks>
-        /// If the current instance was constructed on a provided byte array, a copy of the section of the array
-        /// to which this instance has access is returned.
-        /// </remarks>
         public override byte[] ToArray()
         public override byte[] ToArray()
         {
         {
             if (Capacity == Length)
             if (Capacity == Length)
             {
             {
 #if FEATURE_MEMORYSTREAM_GETBUFFER
 #if FEATURE_MEMORYSTREAM_GETBUFFER
                 return GetBuffer();
                 return GetBuffer();
-#elif FEATURE_MEMORYSTREAM_TRYGETBUFFER
+#else
                 ArraySegment<byte> buffer;
                 ArraySegment<byte> buffer;
                 if (TryGetBuffer(out buffer))
                 if (TryGetBuffer(out buffer))
                     return buffer.Array;
                     return buffer.Array;

+ 1 - 2
src/Renci.SshNet/ForwardedPortDynamic.cs

@@ -4,8 +4,7 @@ using System.Threading;
 namespace Renci.SshNet
 namespace Renci.SshNet
 {
 {
     /// <summary>
     /// <summary>
-    /// Provides functionality for forwarding connections from the client to destination servers via the SSH server,
-    /// also known as dynamic port forwarding.
+    /// Provides functionality for dynamic port forwarding
     /// </summary>
     /// </summary>
     public partial class ForwardedPortDynamic : ForwardedPort
     public partial class ForwardedPortDynamic : ForwardedPort
     {
     {

+ 2 - 2
src/Renci.SshNet/Renci.SshNet.csproj

@@ -18,7 +18,7 @@
     <DebugType>full</DebugType>
     <DebugType>full</DebugType>
     <Optimize>false</Optimize>
     <Optimize>false</Optimize>
     <OutputPath>bin\Debug\</OutputPath>
     <OutputPath>bin\Debug\</OutputPath>
-    <DefineConstants>TRACE;DEBUG;TUNING;FEATURE_RNG_CSP;FEATURE_SOCKET_EAP;FEATURE_STREAM_APM;FEATURE_DNS_SYNC;FEATURE_THREAD_THREADPOOL;FEATURE_THREAD_SLEEP;FEATURE_HASH_MD5;FEATURE_HASH_SHA1;FEATURE_HASH_SHA256;FEATURE_HASH_SHA384;FEATURE_HASH_SHA512;FEATURE_HASH_RIPEMD160;FEATURE_HMAC_MD5;FEATURE_HMAC_SHA1;FEATURE_HMAC_SHA256;FEATURE_HMAC_SHA384;FEATURE_HMAC_SHA512;FEATURE_HMAC_RIPEMD160;FEATURE_MEMORYSTREAM_GETBUFFER</DefineConstants>
+    <DefineConstants>TRACE;DEBUG;TUNING;FEATURE_HASH_MD5;FEATURE_HASH_SHA1;FEATURE_HASH_SHA256;FEATURE_HASH_SHA384;FEATURE_HASH_SHA512;FEATURE_HASH_RIPEMD160;FEATURE_HMAC_MD5;FEATURE_HMAC_SHA1;FEATURE_HMAC_SHA256;FEATURE_HMAC_SHA384;FEATURE_HMAC_SHA512;FEATURE_HMAC_RIPEMD160;FEATURE_MEMORYSTREAM_GETBUFFER;FEATURE_THREAD_SLEEP</DefineConstants>
     <ErrorReport>prompt</ErrorReport>
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
     <WarningLevel>4</WarningLevel>
     <DocumentationFile>bin\Debug\Renci.SshNet.xml</DocumentationFile>
     <DocumentationFile>bin\Debug\Renci.SshNet.xml</DocumentationFile>
@@ -27,7 +27,7 @@
     <DebugType>none</DebugType>
     <DebugType>none</DebugType>
     <Optimize>true</Optimize>
     <Optimize>true</Optimize>
     <OutputPath>bin\Release\</OutputPath>
     <OutputPath>bin\Release\</OutputPath>
-    <DefineConstants>TUNING;FEATURE_RNG_CSP;FEATURE_SOCKET_EAP;FEATURE_STREAM_APM;FEATURE_DNS_SYNC;FEATURE_THREAD_THREADPOOL;FEATURE_THREAD_SLEEP;FEATURE_HASH_MD5;FEATURE_HASH_SHA1;FEATURE_HASH_SHA256;FEATURE_HASH_SHA384;FEATURE_HASH_SHA512;FEATURE_HASH_RIPEMD160;FEATURE_HMAC_MD5;FEATURE_HMAC_SHA1;FEATURE_HMAC_SHA256;FEATURE_HMAC_SHA384;FEATURE_HMAC_SHA512;FEATURE_HMAC_RIPEMD160;FEATURE_MEMORYSTREAM_GETBUFFER</DefineConstants>
+    <DefineConstants>TUNING;FEATURE_HASH_MD5;FEATURE_HASH_SHA1;FEATURE_HASH_SHA256;FEATURE_HASH_SHA384;FEATURE_HASH_SHA512;FEATURE_HASH_RIPEMD160;FEATURE_HMAC_MD5;FEATURE_HMAC_SHA1;FEATURE_HMAC_SHA256;FEATURE_HMAC_SHA384;FEATURE_HMAC_SHA512;FEATURE_HMAC_RIPEMD160</DefineConstants>
     <ErrorReport>prompt</ErrorReport>
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
     <WarningLevel>4</WarningLevel>
     <DocumentationFile>bin\Release\Renci.SshNet.xml</DocumentationFile>
     <DocumentationFile>bin\Release\Renci.SshNet.xml</DocumentationFile>

+ 2 - 4
src/Renci.SshNet/Security/Cryptography/HashAlgorithmFactory.cs

@@ -6,12 +6,10 @@ namespace Renci.SshNet.Security.Cryptography
     {
     {
         public static RandomNumberGenerator CreateRandomNumberGenerator()
         public static RandomNumberGenerator CreateRandomNumberGenerator()
         {
         {
-#if FEATURE_RNG_CREATE
-            return RandomNumberGenerator.Create();
-#elif FEATURE_RNG_CSP
+#if FEATURE_RNG_CRYPTO
             return new RNGCryptoServiceProvider();
             return new RNGCryptoServiceProvider();
 #else
 #else
-            #error Creation of RandomNumberGenerator is not implemented.
+            return RandomNumberGenerator.Create();
 #endif
 #endif
         }
         }
 
 

+ 42 - 98
src/Renci.SshNet/Session.NET.cs

@@ -7,7 +7,6 @@ using Renci.SshNet.Common;
 using Renci.SshNet.Messages.Transport;
 using Renci.SshNet.Messages.Transport;
 using System.Diagnostics;
 using System.Diagnostics;
 using System.Collections.Generic;
 using System.Collections.Generic;
-using System.Threading;
 using Renci.SshNet.Abstractions;
 using Renci.SshNet.Abstractions;
 
 
 namespace Renci.SshNet
 namespace Renci.SshNet
@@ -115,39 +114,17 @@ namespace Renci.SshNet
             Log(string.Format("Initiating connect to '{0}:{1}'.", ConnectionInfo.Host, ConnectionInfo.Port));
             Log(string.Format("Initiating connect to '{0}:{1}'.", ConnectionInfo.Host, ConnectionInfo.Port));
 
 
 #if FEATURE_SOCKET_EAP
 #if FEATURE_SOCKET_EAP
-            var connectCompleted = new ManualResetEvent(false);
-            var connectAsyncEventArgs = new SocketAsyncEventArgs
-                {
-                    RemoteEndPoint = ep,
-                };
-            connectAsyncEventArgs.Completed += (sender, args) => { connectCompleted.Set(); };
-
-            if (_socket.ConnectAsync(connectAsyncEventArgs))
-            {
-                if (!connectCompleted.WaitOne(timeout, false))
-                    throw new SshOperationTimeoutException(
-                        string.Format(
-                            CultureInfo.InvariantCulture,
-                            "Connection failed to establish within {0:F0} milliseconds.",
-                            timeout.TotalMilliseconds));
-            }
-
-            if (connectAsyncEventArgs.SocketError != SocketError.Success)
-                throw new SocketException((int) connectAsyncEventArgs.SocketError);
-#elif FEATURE_SOCKET_APM
+            if (!_socket.ConnectAsync(ep).Wait(timeout))
+                throw new SshOperationTimeoutException(string.Format(CultureInfo.InvariantCulture,
+                    "Connection failed to establish within {0:F0} milliseconds.", timeout.TotalMilliseconds));
+#else
             var connectResult = _socket.BeginConnect(ep, null, null);
             var connectResult = _socket.BeginConnect(ep, null, null);
             if (!connectResult.AsyncWaitHandle.WaitOne(timeout, false))
             if (!connectResult.AsyncWaitHandle.WaitOne(timeout, false))
                 throw new SshOperationTimeoutException(string.Format(CultureInfo.InvariantCulture,
                 throw new SshOperationTimeoutException(string.Format(CultureInfo.InvariantCulture,
                     "Connection failed to establish within {0:F0} milliseconds.", timeout.TotalMilliseconds));
                     "Connection failed to establish within {0:F0} milliseconds.", timeout.TotalMilliseconds));
 
 
             _socket.EndConnect(connectResult);
             _socket.EndConnect(connectResult);
-#elif FEATURE_SOCKET_TAP
-            if (!_socket.ConnectAsync(ep).Wait(timeout))
-                throw new SshOperationTimeoutException(string.Format(CultureInfo.InvariantCulture,
-                    "Connection failed to establish within {0:F0} milliseconds.", timeout.TotalMilliseconds));
-#else
-            #error Connecting socket is not implemented.
-#endif
+#endif // FEATURE_SOCKET_ASYNC_TPL
         }
         }
 
 
         /// <summary>
         /// <summary>
@@ -156,7 +133,6 @@ namespace Renci.SshNet
         /// <exception cref="SocketException">An error occurred when trying to access the socket.</exception>
         /// <exception cref="SocketException">An error occurred when trying to access the socket.</exception>
         partial void SocketDisconnect()
         partial void SocketDisconnect()
         {
         {
-            // TODO should disconnect instead ?!!
             _socket.Dispose();
             _socket.Dispose();
         }
         }
 
 
@@ -172,79 +148,47 @@ namespace Renci.SshNet
             var buffer = new List<byte>();
             var buffer = new List<byte>();
             var data = new byte[1];
             var data = new byte[1];
 
 
-#if FEATURE_SOCKET_EAP
-            var receiveCompleted = new AutoResetEvent(false);
-            var receiveAsyncEventArgs = new SocketAsyncEventArgs { SocketFlags = SocketFlags.None };
-            receiveAsyncEventArgs.Completed += (sender, args) => receiveCompleted.Set();
-            receiveAsyncEventArgs.SetBuffer(data, 0, data.Length);
+            // read data one byte at a time to find end of line and leave any unhandled information in the buffer
+            // to be processed by subsequent invocations
+            do
+            {
+#if FEATURE_SOCKET_TAP
+                var receiveTask = _socket.ReceiveAsync(new ArraySegment<byte>(data, 0, data.Length), SocketFlags.None);
+                if (!receiveTask.Wait(timeout))
+                    throw new SshOperationTimeoutException(string.Format(CultureInfo.InvariantCulture,
+                        "Socket read operation has timed out after {0:F0} milliseconds.", timeout.TotalMilliseconds));
 
 
-#endif // FEATURE_SOCKET_EAP
+                var received = receiveTask.Result;
+#else
+                var asyncResult = _socket.BeginReceive(data, 0, data.Length, SocketFlags.None, null, null);
+                if (!asyncResult.AsyncWaitHandle.WaitOne(timeout))
+                    throw new SshOperationTimeoutException(string.Format(CultureInfo.InvariantCulture,
+                        "Socket read operation has timed out after {0:F0} milliseconds.", timeout.TotalMilliseconds));
 
 
-            try
-            {
-                // read data one byte at a time to find end of line and leave any unhandled information in the buffer
-                // to be processed by subsequent invocations
-                do
-                {
-#if FEATURE_SOCKET_EAP
-                    if (_socket.ReceiveAsync(receiveAsyncEventArgs))
-                    {
-                        if (!receiveCompleted.WaitOne(timeout))
-                            throw new SshOperationTimeoutException(
-                                string.Format(
-                                    CultureInfo.InvariantCulture,
-                                    "Socket read operation has timed out after {0:F0} milliseconds.",
-                                    timeout.TotalMilliseconds));
-                    }
+                var received = _socket.EndReceive(asyncResult);
+#endif // FEATURE_SOCKET_TAP
 
 
-                    var received = receiveAsyncEventArgs.BytesTransferred;
-#elif FEATURE_SOCKET_TAP
-                    var receiveTask = _socket.ReceiveAsync(new ArraySegment<byte>(data, 0, data.Length), SocketFlags.None);
-                    if (!receiveTask.Wait(timeout))
-                        throw new SshOperationTimeoutException(string.Format(CultureInfo.InvariantCulture,
-                            "Socket read operation has timed out after {0:F0} milliseconds.", timeout.TotalMilliseconds));
-
-                    var received = receiveTask.Result;
-    #elif FEATURE_SOCKET_APM
-                    var asyncResult = _socket.BeginReceive(data, 0, data.Length, SocketFlags.None, null, null);
-                    if (!asyncResult.AsyncWaitHandle.WaitOne(timeout))
-                        throw new SshOperationTimeoutException(string.Format(CultureInfo.InvariantCulture,
-                            "Socket read operation has timed out after {0:F0} milliseconds.", timeout.TotalMilliseconds));
-
-                    var received = _socket.EndReceive(asyncResult);
-    #else
-                    #error Receiving from socket is not implemented.
-    #endif
-
-                    if (received == 0)
-                        // the remote server shut down the socket
-                        break;
-
-                    buffer.Add(data[0]);
-                }
-                while (!(buffer.Count > 0 && (buffer[buffer.Count - 1] == LineFeed || buffer[buffer.Count - 1] == Null)));
-
-                if (buffer.Count == 0)
-                    response = null;
-                else if (buffer.Count == 1 && buffer[buffer.Count - 1] == 0x00)
-                    // return an empty version string if the buffer consists of only a 0x00 character
-                    response = string.Empty;
-                else if (buffer.Count > 1 && buffer[buffer.Count - 2] == CarriageReturn)
-                    // strip trailing CRLF
-                    response = SshData.Ascii.GetString(buffer.Take(buffer.Count - 2).ToArray());
-                else if (buffer.Count > 1 && buffer[buffer.Count - 1] == LineFeed)
-                    // strip trailing LF
-                    response = SshData.Ascii.GetString(buffer.Take(buffer.Count - 1).ToArray());
-                else
-                    response = SshData.Ascii.GetString(buffer.ToArray());
-            }
-            finally
-            {
-#if FEATURE_SOCKET_EAP
-                receiveAsyncEventArgs.Dispose();
-                receiveCompleted.Dispose();
-#endif // FEATURE_SOCKET_EAP
+                if (received == 0)
+                    // the remote server shut down the socket
+                    break;
+
+                buffer.Add(data[0]);
             }
             }
+            while (!(buffer.Count > 0 && (buffer[buffer.Count - 1] == LineFeed || buffer[buffer.Count - 1] == Null)));
+
+            if (buffer.Count == 0)
+                response = null;
+            else if (buffer.Count == 1 && buffer[buffer.Count - 1] == 0x00)
+                // return an empty version string if the buffer consists of only a 0x00 character
+                response = string.Empty;
+            else if (buffer.Count > 1 && buffer[buffer.Count - 2] == CarriageReturn)
+                // strip trailing CRLF
+                response = SshData.Ascii.GetString(buffer.Take(buffer.Count - 2).ToArray());
+            else if (buffer.Count > 1 && buffer[buffer.Count - 1] == LineFeed)
+                // strip trailing LF
+                response = SshData.Ascii.GetString(buffer.Take(buffer.Count - 1).ToArray());
+            else
+                response = SshData.Ascii.GetString(buffer.ToArray());
         }
         }
 
 
         /// <summary>
         /// <summary>

+ 4 - 5
src/Renci.SshNet/Shell.cs

@@ -142,7 +142,7 @@ namespace Renci.SshNet
 
 
                     while (_channel.IsOpen)
                     while (_channel.IsOpen)
                     {
                     {
-#if FEATURE_STREAM_TAP
+#if FEATURE_STREAM_ASYNC_TPL
                         var readTask = _input.ReadAsync(buffer, 0, buffer.Length);
                         var readTask = _input.ReadAsync(buffer, 0, buffer.Length);
                         var readWaitHandle = ((IAsyncResult) readTask).AsyncWaitHandle;
                         var readWaitHandle = ((IAsyncResult) readTask).AsyncWaitHandle;
 
 
@@ -156,7 +156,8 @@ namespace Renci.SshNet
 #endif
 #endif
                             continue;
                             continue;
                         }
                         }
-#elif FEATURE_STREAM_APM
+
+#else
                         var asyncResult = _input.BeginRead(buffer, 0, buffer.Length, delegate(IAsyncResult result)
                         var asyncResult = _input.BeginRead(buffer, 0, buffer.Length, delegate(IAsyncResult result)
                         {
                         {
                             //  If input stream is closed and disposed already dont finish reading the stream
                             //  If input stream is closed and disposed already dont finish reading the stream
@@ -179,9 +180,7 @@ namespace Renci.SshNet
 
 
                         if (asyncResult.IsCompleted)
                         if (asyncResult.IsCompleted)
                             continue;
                             continue;
-#else
-#error Async receive is not implemented.
-#endif
+#endif // FEATURE_STREAM_ASYNC_TPL
                         break;
                         break;
                     }
                     }
                 }
                 }