From 32becde5adaf09fc8207bb552dbb2f7742e73966 Mon Sep 17 00:00:00 2001 From: drieseng Date: Sun, 24 Jul 2016 10:12:15 +0200 Subject: [PATCH] Mark port started before StartAccept because StartAccept is a noop when the port is not started. --- src/Renci.SshNet/ForwardedPortDynamic.NET.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Renci.SshNet/ForwardedPortDynamic.NET.cs b/src/Renci.SshNet/ForwardedPortDynamic.NET.cs index 6f626a16..018ec6ef 100644 --- a/src/Renci.SshNet/ForwardedPortDynamic.NET.cs +++ b/src/Renci.SshNet/ForwardedPortDynamic.NET.cs @@ -34,10 +34,10 @@ namespace Renci.SshNet Session.ErrorOccured += Session_ErrorOccured; Session.Disconnected += Session_Disconnected; - StartAccept(null); - // consider port started when we're listening for inbound connections _status = ForwardedPortStatus.Started; + + StartAccept(null); } private void StartAccept(SocketAsyncEventArgs e)