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 @@
-
+