Переглянути джерело

Added back signaling of socket read.

drieseng 9 роки тому
батько
коміт
bba2e5bad6
1 змінених файлів з 5 додано та 0 видалено
  1. 5 0
      src/Renci.SshNet/Session.cs

+ 5 - 0
src/Renci.SshNet/Session.cs

@@ -1870,7 +1870,12 @@ namespace Renci.SshNet
         void SocketRead(int length, ref byte[] buffer)
         {
             if (SocketAbstraction.Read(_socket, buffer, 0, length, ConnectionInfo.Timeout) > 0)
+            {
+                // signal that bytes have been read from the socket
+                // this is used to improve accuracy of Session.IsSocketConnected
+                _bytesReadFromSocket.Set();
                 return;
+            }
 
             // 2012-09-11: Kenneth_aa
             // When Disconnect or Dispose is called, this throws SshConnectionException(), which...