www.libssh2.org | Daily snapshots | Mailing list archive | Docs | Examples

Archive Index This month's Index

Subject: Re: [libssh2] Failing to create multiple channels in windows

Re: [libssh2] Failing to create multiple channels in windows

From: Sabyasachi Ruj <ruj.sabya_at_gmail.com>
Date: Fri, 25 Jan 2008 18:17:08 +0530

On Jan 25, 2008 5:30 PM, Peter Stuge <peter_at_stuge.se> wrote:

> On Fri, Jan 25, 2008 at 01:27:54PM +0530, Sabyasachi Ruj wrote:
> > channel1 = libssh2_channel_direct_tcpip(session, "192.168.1.3",
> 3306);
> > if (channel1 == 0)
> > bail("Failed channel forwarding: channel1\n");
> > else
> > printf("channel connected (%x)\n",channel1);
> >
> >
> > /*
> > HERE THE ERROR OCCURS: In Windows it fails.
> > In linux we can create the channel successfully
> > */
> >
> > channel2 = libssh2_channel_direct_tcpip(session, "192.168.1.3",
> 3306);
>
> Have you tried with a different IP or port?

Yes. but the problem persists.

>
>
> > if (channel2 == 0)
> > bail("Failed channel forwarding: channel2\n");
> > else
> > printf("channel connected (%x)\n",channel2);
>
> Also - is there some kind of error message you can get from libssh2?
>

No there is no error message.
libssh2_session_last_error<http://www.libssh2.org/wiki/index.php/Libssh2_session_last_error>()
returns zero.

After further inspection I got:
When I am calling 'libssh2_channel_direct_tcpip' second time,
        channel2 = libssh2_channel_direct_tcpip (session, "192.168.1.3",
3306);
The 'libssh2_packet_read' returns -1 (at line 356 of transport.c):-
And that is causing the problem.

This is because 'recv' returns zero (at line 326 of transport.c).

> //Peter
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> libssh2-devel mailing list
> libssh2-devel_at_lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/libssh2-devel
>

-- 
Sabyasachi

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

_______________________________________________
libssh2-devel mailing list
libssh2-devel_at_lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libssh2-devel
Received on 2008-01-25

the libssh2 team