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




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

Parameters

addr
The IPEndPoint where the local socket shall be bound 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