PowerTCP SSH and SFTP for .NET
CreateLocalPortForwarder(Int32,String,Int32) Method




The local port the LocalPortForwarder shall bind to.
The target address (IP or hostname).
The target port.
Creates a new LocalPortForwarder.
Syntax
'Declaration
 
Public Overloads Function CreateLocalPortForwarder( _
   ByVal local_port As Integer, _
   ByVal host_to_connect As String, _
   ByVal port_to_connect As Integer _
) As LocalPortForwarder
'Usage
 
Dim instance As SshConnection
Dim local_port As Integer
Dim host_to_connect As String
Dim port_to_connect As Integer
Dim value As LocalPortForwarder
 
value = instance.CreateLocalPortForwarder(local_port, host_to_connect, port_to_connect)
public LocalPortForwarder CreateLocalPortForwarder( 
   int local_port,
   string host_to_connect,
   int port_to_connect
)
public: LocalPortForwarder* CreateLocalPortForwarder( 
   int local_port,
   string* host_to_connect,
   int port_to_connect
) 
public:
LocalPortForwarder^ CreateLocalPortForwarder( 
   int local_port,
   String^ host_to_connect,
   int port_to_connect
) 

Parameters

local_port
The local port the LocalPortForwarder shall bind to.
host_to_connect
The target address (IP or hostname).
port_to_connect
The target port.

Return Value

Exceptions
ExceptionDescription
System.InvalidOperationExceptionThrown if there is an error condition, e.g., if the underlying connection is closed or not authenticated.
Remarks

A LocalPortForwarder forwards TCP/IP connections that arrive at a local port via the secure tunnel to another host (which may or may not be identical to the remote SSH-2 server).

This method must only be called after the authentication step has successfully completed. There is no limit on the number of concurrent forwardings, however some servers may impose such a limit.

See Also

Reference

SshConnection Class
SshConnection Members
Overload List


PowerTCP SSH and SFTP for .NET Documentation Version 7.0
© 2023 Dart Communications. All Rights Reserved.
Send comments on this topic