Dmitry Teslenko wrote:
> Is libssh2 capable of creating mutiple direct tcpip channels on win32
> Is it capable of connect to one host and forward port to another host,
> i.e. -L<port>:<one host>:<port> <user>@<another host>?
This is just the above question repeated with an example. Still yes.
> I there's not so much open source software that uses libssh2 to
> look for example. I found medusa, ksftpgrabber and perl/php bindings
> only. Can you point to usable example or provide hint how to do it?
There is an example of how to use direct-tcpip channels with libssh2
in example/direct-tcpip.c which you may have seen.
> I guess channel init should be in blocking mode and
> data transfer should be in non-blocking mode.
Daniel Stenberg wrote:
>> I guess channel init should be in blocking mode
> You never _need_ to use blocking mode, but you can most often opt
> to use it.
Whenever more than a single libssh2 channel is open it is absolutely
neccessary to use *non-blocking* mode, to have working communication.
This is also demonstrated in example/direct-tcpip.c and I know that
it is a really ugly construct but it is the only option until the
libssh2 API gets extended a bit. We've been talking about this for a
>> data transfer should be in non-blocking mode.
> Yes, mostly due to the fact that you currently can't really figure out
> which channel that has traffic when you know there's something to read
> from the socket so you need to check them all and then you don't want
> to block on any.
Received on 2011-01-17