From 66dcb0bfcb60338aa8d1a20c2fc5109f85296cb5 Mon Sep 17 00:00:00 2001 From: Gert Driesen Date: Sun, 5 Nov 2017 15:30:51 +0100 Subject: [PATCH] Ensure keep-alive timer is created when KeepAliveInterval is set after the connection has been established. Fixes issue #334. --- .../Renci.SshNet.Tests.NET35.csproj | 14 +- ...Connected_KeepAliveInterval_NegativeOne.cs | 121 ++++++++++++++++++ ...nected_KeepAliveInterval_NotNegativeOne.cs | 116 +++++++++++++++++ ...Connected_KeepAlivesNotSentConcurrently.cs | 27 +++- ...nected_KeepAliveInterval_NotNegativeOne.cs | 115 +++++++++++++++++ ...nected_KeepAliveInterval_NotNegativeOne.cs | 102 +++++++++++++++ .../Renci.SshNet.Tests.csproj | 4 + src/Renci.SshNet/BaseClient.cs | 37 +++++- src/Renci.SshNet/Session.cs | 2 +- 9 files changed, 523 insertions(+), 15 deletions(-) create mode 100644 src/Renci.SshNet.Tests/Classes/BaseClientTest_Connected_KeepAliveInterval_NegativeOne.cs create mode 100644 src/Renci.SshNet.Tests/Classes/BaseClientTest_Connected_KeepAliveInterval_NotNegativeOne.cs create mode 100644 src/Renci.SshNet.Tests/Classes/BaseClientTest_Disconnected_KeepAliveInterval_NotNegativeOne.cs create mode 100644 src/Renci.SshNet.Tests/Classes/BaseClientTest_NotConnected_KeepAliveInterval_NotNegativeOne.cs diff --git a/src/Renci.SshNet.Tests.NET35/Renci.SshNet.Tests.NET35.csproj b/src/Renci.SshNet.Tests.NET35/Renci.SshNet.Tests.NET35.csproj index 33c9b1c29..bb1f0247c 100644 --- a/src/Renci.SshNet.Tests.NET35/Renci.SshNet.Tests.NET35.csproj +++ b/src/Renci.SshNet.Tests.NET35/Renci.SshNet.Tests.NET35.csproj @@ -78,9 +78,21 @@ Classes\ForwardedPortStatusTest_Stopping.cs + + Classes\BaseClientTest_Connected_KeepAliveInterval_NegativeOne.cs + + + Classes\BaseClientTest_Connected_KeepAliveInterval_NotNegativeOne.cs + Classes\BaseClientTest_Connected_KeepAlivesNotSentConcurrently.cs + + Classes\BaseClientTest_Disconnected_KeepAliveInterval_NotNegativeOne.cs + + + Classes\BaseClientTest_NotConnected_KeepAliveInterval_NotNegativeOne.cs + Classes\Channels\ChannelDirectTcpipTest.cs @@ -1692,7 +1704,7 @@ - +