Explorar el Código

Added back signaling of socket read.

drieseng hace 9 años
padre
commit
bba2e5bad6
Se han modificado 1 ficheros con 5 adiciones y 0 borrados
  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...