diff options
author | Alexey 'Cluster' Avdyukhin <clusterrr@clusterrr.com> | 2017-03-18 04:10:14 +0300 |
---|---|---|
committer | Alexey 'Cluster' Avdyukhin <clusterrr@clusterrr.com> | 2017-03-18 04:10:14 +0300 |
commit | 24d29a664710d19107b23a3430995daf648c54ff (patch) | |
tree | 4ae59aadb02beeafbe61b94780429c6fdbfaa35e /Clovershell/ClovershellConnection.cs | |
parent | 2cfa9b56d436a4a378571071dd16cf15208beacb (diff) |
Changed uploading algorithm
Diffstat (limited to 'Clovershell/ClovershellConnection.cs')
-rw-r--r-- | Clovershell/ClovershellConnection.cs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/Clovershell/ClovershellConnection.cs b/Clovershell/ClovershellConnection.cs index acdeae75..39f18ac5 100644 --- a/Clovershell/ClovershellConnection.cs +++ b/Clovershell/ClovershellConnection.cs @@ -487,7 +487,8 @@ namespace com.clusterrr.clovershell if (c == null) return;
if (c.stdout != null)
c.stdout.Write(data, pos, len);
- Debug.WriteLine("stdout: " + Encoding.UTF8.GetString(data, pos, len));
+ c.LastDataTime = DateTime.Now;
+ //Debug.WriteLine("stdout: " + Encoding.UTF8.GetString(data, pos, len));
if (len == 0)
c.stdoutFinished = true;
}
@@ -501,6 +502,7 @@ namespace com.clusterrr.clovershell #if DEBUG
//Debug.WriteLine("stderr: " + Encoding.UTF8.GetString(data, pos, len));
#endif
+ c.LastDataTime = DateTime.Now;
if (len == 0)
c.stderrFinished = true;
}
@@ -532,7 +534,7 @@ namespace com.clusterrr.clovershell }
catch (ClovershellException ex)
{
- Debug.WriteLine("Socket write error: " + ex.Message+ex.StackTrace);
+ Debug.WriteLine("Socket write error: " + ex.Message + ex.StackTrace);
}
}
@@ -594,7 +596,7 @@ namespace com.clusterrr.clovershell Thread.Sleep(50);
if (!IsOnline)
throw new ClovershellException("device goes offline");
- if (timeout > 0 && IdleTime.TotalMilliseconds > timeout)
+ if (!c.finished && timeout > 0 && (DateTime.Now - c.LastDataTime).TotalMilliseconds > timeout)
throw new ClovershellException("clovershell read timeout");
}
if (throwOnNonZero && c.result != 0)
|