How to get response stream from server

May 8, 2015 at 9:48 AM
Hello All,


I have server application running on linux and using SSH.Net as client.
Server application is listening on localhost and port 9001.
After providing credential I am able to connect server application can pass data as stream and server application is responding with data.

Server should send some data back that I am not able to capture. I am stuck in getting data back from server.



Channel channel = session.openChannel("direct-tcpip");
            //(channel).setInputStream(Console.OpenStandardInput());
            str ss = new str();
            ss.message_sequence_number = 4;
            ss.message_type = 0;

            var ba = StructureToByteArray(ss);
            Stream strm = new MemoryStream(ba);

            (channel).setInputStream(strm, true);


            (channel).setOutputStream(Console.OpenStandardOutput(), true);
            //(channel).setOutputStream(ms, true);

            ((ChannelDirectTCPIP) channel).setHost(host);
            ((ChannelDirectTCPIP) channel).setPort(port);

           channel.connect();
//doubt in this line
            FSM.DotNetSSH.java.io.InputStream fis = channel.getInputStream(); 


             while (!channel.isClosed())
            {
                var a = channel.getInputStream();
                Stream b = channel.getOutputStream();
                Thread.Sleep(500);
                FSM.DotNetSSH.jsch.Buffer bufff = new FSM.DotNetSSH.jsch.Buffer();
                session.read(bufff);
            }

Please provide technical help how to get back data, here I am casting structure object to stream array and sending, note: server application is written in C++ application.
sinha.vishal0@gmail.com