From fd428dd61763ff1355b034c45f36e24ba8509822 Mon Sep 17 00:00:00 2001 From: olegkap_cp Date: Sun, 27 Jan 2013 01:13:53 +0000 Subject: [PATCH] Fix some tests Update all projects to generate xml documentation file Cross project fixes to make it compilable for all projects --- .../Renci.SshNet.NET35/Common/Extensions.NET35.cs | 10 ++++++++++ .../Common/Extensions.SilverlightShared.cs | 11 +++++++++++ .../Renci.SshNet.Silverlight.csproj | 3 ++- .../Renci.SshNet.Silverlight5.csproj | 7 +++++-- .../KeyExchangeDhGroupExchangeRequestTest.cs | 2 +- .../Renci.SshNet.Tests/Classes/SshClientTest.cs | 9 +++++++-- .../Renci.SshNet.WindowsPhone.csproj | 3 ++- .../Renci.SshNet.WindowsPhone8.csproj | 3 ++- .../Renci.SshNet/Channels/ChannelDirectTcpip.cs | 2 +- .../Renci.SshNet/Channels/ChannelForwardedTcpip.cs | 2 +- .../Renci.SshNet/Common/Extensions.NET40.cs | 11 +++++++++++ Renci.SshClient/Renci.SshNet/Session.cs | 2 +- 12 files changed, 54 insertions(+), 11 deletions(-) diff --git a/Renci.SshClient/Renci.SshNet.NET35/Common/Extensions.NET35.cs b/Renci.SshClient/Renci.SshNet.NET35/Common/Extensions.NET35.cs index 5cd2626f..847931cc 100644 --- a/Renci.SshClient/Renci.SshNet.NET35/Common/Extensions.NET35.cs +++ b/Renci.SshClient/Renci.SshNet.NET35/Common/Extensions.NET35.cs @@ -78,5 +78,15 @@ namespace Renci.SshNet value.Length = 0; value.Capacity = 16; } + + internal static bool CanRead(this Socket socket) + { + return socket.Connected && socket.Poll(-1, SelectMode.SelectRead) && socket.Available > 0; + } + + internal static bool CanWrite(this Socket socket) + { + return socket.Connected && socket.Poll(-1, SelectMode.SelectWrite); + } } } diff --git a/Renci.SshClient/Renci.SshNet.Silverlight/Common/Extensions.SilverlightShared.cs b/Renci.SshClient/Renci.SshNet.Silverlight/Common/Extensions.SilverlightShared.cs index 4942251c..43206f5b 100644 --- a/Renci.SshClient/Renci.SshNet.Silverlight/Common/Extensions.SilverlightShared.cs +++ b/Renci.SshClient/Renci.SshNet.Silverlight/Common/Extensions.SilverlightShared.cs @@ -66,5 +66,16 @@ namespace Renci.SshNet.Common algorithm.Clear(); } + + internal static bool CanRead(this Socket socket) + { + return socket.Connected; + } + + internal static bool CanWrite(this Socket socket) + { + return socket.Connected; + } + } } diff --git a/Renci.SshClient/Renci.SshNet.Silverlight/Renci.SshNet.Silverlight.csproj b/Renci.SshClient/Renci.SshNet.Silverlight/Renci.SshNet.Silverlight.csproj index c10c1fe4..4b3b3c18 100644 --- a/Renci.SshClient/Renci.SshNet.Silverlight/Renci.SshNet.Silverlight.csproj +++ b/Renci.SshClient/Renci.SshNet.Silverlight/Renci.SshNet.Silverlight.csproj @@ -38,6 +38,7 @@ true prompt 4 + Bin\Debug\Renci.SshNet.Silverlight.XML pdbonly @@ -812,7 +813,7 @@ - +