[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Two direct port forward channels within one session - can't read the data


Hello,
I am new with libssh and trying to use it in my project. I want to use libssh to direct port forwarding for tunneling connection from my app to Firebird DB on remote server.
Because project is programmed in C# I wrote little wrapper for libssh library but there's no problem I think.

I'm able to connect to the remote server, authorize user and create forwarding channel when I need connection to the Firebird server. While I using only one channel there is no problem and I can read and write data trough open channel with ssh_channel_read and ssh_channel_write functions. The problem occures when I want to serve second connection to Firebird server and create second forward channel (so there are two living fwd channels in one session). Then I can't read data from channel after few readings and writings happens on the second channel (not same count of r/w every time - it varies from connection to connection). I tried to use callback function (ssh_channel_data_callback) on channel and it seems that the data is present because callback function is fired up. But then data is not "transfered" to ssh_channel_read function.

So there are my questions:
    Can be used two fwd channels in one session to transfer data at the same time?
    Can be used two fwd channels in one session to transfer data with use of ssh_channel_read and ssh_channel_write functions at the same time? Or should I use ssh_channel_select function?
    Is there any trick to make it work?

Thank you very much for your help. Sorry for my English.

Regards,
Tomas Havranek



Follow-Ups:
Re: Two direct port forward channels within one session - can't read the data"Ing. Tomáš Havránek" <havrus@xxxxxxxxxx>
Archive administrator: postmaster@lists.cynapses.org