|
@@ -27,8 +27,20 @@ namespace Renci.SshNet.Tests.Common
|
|
|
{
|
|
{
|
|
|
_endPoint = endPoint;
|
|
_endPoint = endPoint;
|
|
|
_acceptCallbackDone = new ManualResetEvent(false);
|
|
_acceptCallbackDone = new ManualResetEvent(false);
|
|
|
|
|
+ ShutdownRemoteCommunicationSocket = true;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /// <summary>
|
|
|
|
|
+ /// Gets a value indicating whether the <see cref="Socket.Shutdown(SocketShutdown)"/> is invoked on the <see cref="Socket"/>
|
|
|
|
|
+ /// that is used to handle the communication with the remote host, when the remote host has closed the connection.
|
|
|
|
|
+ /// </summary>
|
|
|
|
|
+ /// <value>
|
|
|
|
|
+ /// <see langword="true"/> to invoke <see cref="Socket.Shutdown(SocketShutdown)"/> on the <see cref="Socket"/> that is used
|
|
|
|
|
+ /// to handle the communication with the remote host, when the remote host has closed the connection; otherwise,
|
|
|
|
|
+ /// <see langword="false""/>. The default is <see langword="true"/>.
|
|
|
|
|
+ /// </value>
|
|
|
|
|
+ public bool ShutdownRemoteCommunicationSocket { get; set; }
|
|
|
|
|
+
|
|
|
public void Start()
|
|
public void Start()
|
|
|
{
|
|
{
|
|
|
_listener = new Socket(_endPoint.AddressFamily, SocketType.Stream, ProtocolType.Tcp);
|
|
_listener = new Socket(_endPoint.AddressFamily, SocketType.Stream, ProtocolType.Tcp);
|
|
@@ -127,8 +139,12 @@ namespace Renci.SshNet.Tests.Common
|
|
|
else
|
|
else
|
|
|
{
|
|
{
|
|
|
SignalDisconnected(handler);
|
|
SignalDisconnected(handler);
|
|
|
- handler.Shutdown(SocketShutdown.Both);
|
|
|
|
|
- handler.Close();
|
|
|
|
|
|
|
+
|
|
|
|
|
+ if (ShutdownRemoteCommunicationSocket)
|
|
|
|
|
+ {
|
|
|
|
|
+ handler.Shutdown(SocketShutdown.Both);
|
|
|
|
|
+ handler.Close();
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|