We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5c29394 commit 9c454baCopy full SHA for 9c454ba
src/Renci.SshNet/ForwardedPortDynamic.cs
@@ -40,7 +40,7 @@ public class ForwardedPortDynamic : ForwardedPort
40
/// <summary>
41
/// Gets the bound port.
42
/// </summary>
43
- public uint BoundPort { get; }
+ public uint BoundPort { get; private set; }
44
45
private Socket _listener;
46
private CountdownEvent _pendingChannelCountdown;
@@ -168,6 +168,9 @@ private void InternalStart()
168
_listener.Bind(ep);
169
_listener.Listen(5);
170
171
+ // update bound port (in case original was passed as zero)
172
+ BoundPort = (uint)((IPEndPoint)_listener.LocalEndPoint).Port;
173
+
174
Session.ErrorOccured += Session_ErrorOccured;
175
Session.Disconnected += Session_Disconnected;
176
0 commit comments