ForwardedPortRemote.NET.cs 1.5 KB

123456789101112131415161718192021222324252627282930313233343536
  1. using System.Net;
  2. namespace Renci.SshNet
  3. {
  4. /// <summary>
  5. /// Provides functionality for remote port forwarding
  6. /// </summary>
  7. public partial class ForwardedPortRemote
  8. {
  9. /// <summary>
  10. /// Initializes a new instance of the <see cref="ForwardedPortRemote"/> class.
  11. /// </summary>
  12. /// <param name="boundPort">The bound port.</param>
  13. /// <param name="host">The host.</param>
  14. /// <param name="port">The port.</param>
  15. /// <example>
  16. /// <code source="..\..\Renci.SshNet.Tests\Classes\ForwardedPortRemoteTest.cs" region="Example SshClient AddForwardedPort Start Stop ForwardedPortRemote" language="C#" title="Remote port forwarding" />
  17. /// </example>
  18. public ForwardedPortRemote(uint boundPort, string host, uint port)
  19. : this(string.Empty, boundPort, host, port)
  20. {
  21. }
  22. /// <summary>
  23. /// Initializes a new instance of the <see cref="ForwardedPortRemote"/> class.
  24. /// </summary>
  25. /// <param name="boundHost">The bound host.</param>
  26. /// <param name="boundPort">The bound port.</param>
  27. /// <param name="host">The host.</param>
  28. /// <param name="port">The port.</param>
  29. public ForwardedPortRemote(string boundHost, uint boundPort, string host, uint port)
  30. : this(Dns.GetHostEntry(boundHost).AddressList[0], boundPort, Dns.GetHostEntry(host).AddressList[0], port)
  31. {
  32. }
  33. }
  34. }