Subject: Re: Help with libssh2_channel_direct_tcpip_ex

Re: Help with libssh2_channel_direct_tcpip_ex

From: Peter Stuge <peter_at_stuge.se>
Date: Tue, 16 Feb 2010 19:12:34 +0100

Kumar, Ashish wrote:
> while( ( channel = libssh2_channel_direct_tcpip_ex(
> session,targethostname , 22 , hostname, 22 ) ) == NULL)
..
> When I use the channel for below purpose
..
> while( (rc = libssh2_channel_exec(channel, commandline)) ==
> LIBSSH2_ERROR_EAGAIN );

> Can you give me hint to explore further into where could I be going
> wrong ?

You seem to be confusing the purpose of these function calls.

libssh2_channel_exec() can only be used with a channel that was
created by libssh2_channel_open_session().

libssh2_channel_direct_tcpip_ex() creates a different type of
channel. Please read RFC4254 to learn more about direct-tcpip
channels.

//Peter
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
Received on 2010-02-16