@@ -43,7 +43,7 @@ public string BoundHost
43
43
{
44
44
get
45
45
{
46
- return BoundHostAddress . ToString ( ) ;
46
+ return BoundHostAddress ? . ToString ( ) ?? string . Empty ;
47
47
}
48
48
}
49
49
@@ -86,11 +86,6 @@ public string Host
86
86
/// <exception cref="ArgumentOutOfRangeException"><paramref name="port" /> is greater than <see cref="IPEndPoint.MaxPort" />.</exception>
87
87
public ForwardedPortRemote ( IPAddress boundHostAddress , uint boundPort , IPAddress hostAddress , uint port )
88
88
{
89
- if ( boundHostAddress is null )
90
- {
91
- throw new ArgumentNullException ( nameof ( boundHostAddress ) ) ;
92
- }
93
-
94
89
if ( hostAddress is null )
95
90
{
96
91
throw new ArgumentNullException ( nameof ( hostAddress ) ) ;
@@ -116,7 +111,7 @@ public ForwardedPortRemote(IPAddress boundHostAddress, uint boundPort, IPAddress
116
111
/// <code source="..\..\src\Renci.SshNet.Tests\Classes\ForwardedPortRemoteTest.cs" region="Example SshClient AddForwardedPort Start Stop ForwardedPortRemote" language="C#" title="Remote port forwarding" />
117
112
/// </example>
118
113
public ForwardedPortRemote ( uint boundPort , string host , uint port )
119
- : this ( string . Empty , boundPort , host , port )
114
+ : this ( boundHost : null , boundPort , host , port )
120
115
{
121
116
}
122
117
@@ -128,7 +123,7 @@ public ForwardedPortRemote(uint boundPort, string host, uint port)
128
123
/// <param name="host">The host.</param>
129
124
/// <param name="port">The port.</param>
130
125
public ForwardedPortRemote ( string boundHost , uint boundPort , string host , uint port )
131
- : this ( DnsAbstraction . GetHostAddresses ( boundHost ) [ 0 ] ,
126
+ : this ( boundHost == null ? null : DnsAbstraction . GetHostAddresses ( boundHost ) [ 0 ] ,
132
127
boundPort ,
133
128
DnsAbstraction . GetHostAddresses ( host ) [ 0 ] ,
134
129
port )
0 commit comments