OpenTcpIpChannel Method

Opens a special TCP/IP tunneling SSHChannel .

Syntax

ANSI (Cross Platform)
char* OpenTcpIpChannel(const char* lpszDestHost, int iDestPort, const char* lpszSrcHost, int iSrcPort);

Unicode (Windows)
LPWSTR OpenTcpIpChannel(LPCWSTR lpszDestHost, INT iDestPort, LPCWSTR lpszSrcHost, INT iSrcPort);
- (NSString*)openTcpIpChannel:(NSString*)destHost :(int)destPort :(NSString*)srcHost :(int)srcPort;
#define MID_SSHCLIENT_OPENTCPIPCHANNEL 11

IPWORKSSSH_EXTERNAL int IPWORKSSSH_CALL IPWorksSSH_SSHClient_Do(void *lpObj, int methid, int cparam, void *param[], int cbparam[], int64 *lpllVal);

Remarks

OpenTcpIpChannel opens a special SSHChannel of type "direct-tcpip". Unlike channels opened by OpenChannel, "direct-tcpip" channels are secured data tunnels that forward data through the SSHHost to another destination.

DestHost and DestPort represent, respectively, the host name or IP address and the port for which the data of this channel is bound. When OpenTcpIpChannel is called, the SSHHost will attempt to connect to the machine identified by these parameters.

Likewise, SrcHost and SrcPort identify the originator of the data. These may be different from LocalHost and LocalPort if the current instance of the class is being used to forward data from another TCP/IP client.

Error Handling (C++)

This method returns a String value; after it returns, call the GetLastErrorCode() method to obtain its result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. If an error occurs, the GetLastError() method can be called to retrieve the associated error message.

Copyright (c) 2023 /n software inc. - All rights reserved.
IPWorks SSH 2020 C++ Edition - Version 20.0 [Build 8501]