Where appropriate change all -1 and Timespan(0,0,0,-1) to SshNet.Session.Infinite and SshNet.Session.InfiniteTimeSpan

This commit is contained in:
Matthew Vukomanovic
2016-05-19 14:51:17 +08:00
parent 8854821436
commit 2fd25cb2cb
5 changed files with 7 additions and 7 deletions
@@ -57,7 +57,7 @@ namespace Renci.SshNet.Tests.Classes.Channels
new MessageEventArgs<ChannelOpenConfirmationMessage>(
new ChannelOpenConfirmationMessage(((ChannelOpenMessage)m).LocalChannelNumber, _remoteWindowSize, _remotePacketSize, _remoteChannelNumber))));
_sessionMock.Setup(p => p.WaitOnHandle(It.IsAny<EventWaitHandle>()))
.Callback<WaitHandle>(p => p.WaitOne(-1));
.Callback<WaitHandle>(p => p.WaitOne(Session.Infinite));
var localPortEndPoint = new IPEndPoint(IPAddress.Loopback, 8122);
using (var localPortListener = new AsyncSocketListener(localPortEndPoint))
@@ -107,7 +107,7 @@ namespace Renci.SshNet.Tests.Classes.Channels
new MessageEventArgs<ChannelOpenConfirmationMessage>(
new ChannelOpenConfirmationMessage(((ChannelOpenMessage)m).LocalChannelNumber, _remoteWindowSize, _remotePacketSize, _remoteChannelNumber))));
_sessionMock.Setup(p => p.WaitOnHandle(It.IsAny<EventWaitHandle>()))
.Callback<WaitHandle>(p => p.WaitOne(-1));
.Callback<WaitHandle>(p => p.WaitOne(Session.Infinite));
var localPortEndPoint = new IPEndPoint(IPAddress.Loopback, 8122);
using (var localPortListener = new AsyncSocketListener(localPortEndPoint))
@@ -159,7 +159,7 @@ namespace Renci.SshNet.Tests.Classes.Channels
new ChannelOpenConfirmationMessage(((ChannelOpenMessage) m).LocalChannelNumber,
_remoteWindowSize, _remotePacketSize, _remoteChannelNumber))));
_sessionMock.Setup(p => p.WaitOnHandle(It.IsAny<EventWaitHandle>()))
.Callback<WaitHandle>(p => p.WaitOne(-1));
.Callback<WaitHandle>(p => p.WaitOne(Session.Infinite));
_sessionMock.Setup(p => p.ConnectionInfo).Returns(_connectionInfoMock.Object);
_connectionInfoMock.Setup(p => p.Timeout).Returns(TimeSpan.FromSeconds(60));
_sessionMock.Setup(p => p.TrySendMessage(It.IsAny<ChannelEofMessage>()))
+1 -1
View File
@@ -126,7 +126,7 @@ namespace Renci.SshNet
internal NetConfClient(ConnectionInfo connectionInfo, bool ownsConnectionInfo, IServiceFactory serviceFactory)
: base(connectionInfo, ownsConnectionInfo, serviceFactory)
{
OperationTimeout = new TimeSpan(0, 0, 0, 0, -1);
OperationTimeout = SshNet.Session.InfiniteTimeSpan;
AutomaticMessageIdHandling = true;
}
+1 -1
View File
@@ -144,7 +144,7 @@ namespace Renci.SshNet
internal ScpClient(ConnectionInfo connectionInfo, bool ownsConnectionInfo, IServiceFactory serviceFactory)
: base(connectionInfo, ownsConnectionInfo, serviceFactory)
{
OperationTimeout = new TimeSpan(0, 0, 0, 0, -1);
OperationTimeout = SshNet.Session.InfiniteTimeSpan;
BufferSize = 1024 * 16;
if (_byteToChar == null)
+1 -1
View File
@@ -229,7 +229,7 @@ namespace Renci.SshNet
internal SftpClient(ConnectionInfo connectionInfo, bool ownsConnectionInfo, IServiceFactory serviceFactory)
: base(connectionInfo, ownsConnectionInfo, serviceFactory)
{
OperationTimeout = new TimeSpan(0, 0, 0, 0, -1);
OperationTimeout = SshNet.Session.InfiniteTimeSpan;
BufferSize = 1024 * 32;
}
+1 -1
View File
@@ -143,7 +143,7 @@ namespace Renci.SshNet
_session = session;
CommandText = commandText;
_encoding = encoding;
CommandTimeout = new TimeSpan(0, 0, 0, 0, -1);
CommandTimeout = SshNet.Session.InfiniteTimeSpan;
_sessionErrorOccuredWaitHandle = new AutoResetEvent(false);
_session.Disconnected += Session_Disconnected;