Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/Renci.SshNet/ForwardedPortDynamic.cs
Original file line numberDiff line numberDiff line change
Expand Up@@ -40,7 +40,7 @@ public class ForwardedPortDynamic : ForwardedPort
/// <summary>
/// Gets the bound port.
/// </summary>
public uint BoundPort { get; }
public uint BoundPort { get; private set; }

private Socket _listener;
private CountdownEvent _pendingChannelCountdown;
Expand DownExpand Up@@ -168,6 +168,9 @@ private void InternalStart()
_listener.Bind(ep);
_listener.Listen(5);

// update bound port (in case original was passed as zero)
BoundPort = (uint)((IPEndPoint)_listener.LocalEndPoint).Port;

Session.ErrorOccured += Session_ErrorOccured;
Session.Disconnected += Session_Disconnected;

Expand Down