This project is read-only.

How to get response stream from server

May 8, 2015 at 10: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");
            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);

//doubt in this line
   fis = channel.getInputStream(); 

             while (!channel.isClosed())
                var a = channel.getInputStream();
                Stream b = channel.getOutputStream();
                FSM.DotNetSSH.jsch.Buffer bufff = new FSM.DotNetSSH.jsch.Buffer();

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.