Hi Guys,

I've been trying to figure out for a while how to transfer data from the
server to the client, I'm implementing both sides, with mina and sshd.
Here's a schema of how I want the connection to work:

client connects server
server pushes data to the client
client reads data and responses server
server send last info and closes connection

I haven't had any problem creating the server, and the client connecting
and authenticating, but when pushing the data (I was able to pull a file
from the server to the client through scp but I want to do it with Input
and output streams because is data that needs to be as updated as possible)
I can't get it working I have tried pushing the information from the server:
    @Override
    public boolean authenticate(String user, String password,
            ServerSession session) {
            Buffer buffer =
session.createBuffer(Message.SSH_MSG_CHANNEL_EOF, 0);
            byte[] data = serverInfo.getBytes("UTF-16");
            buffer.putString(data);
            session.writePacket(buffer);
            return true
     }

in the authenticate method, i use SSH_MSG_CHANNEL_EOF, just to see if I can
listen somehow in the client to retrieve the data, but i haven't been able,
and furthermore, I don't know how to use the client (which channel should I
use and how) to pull the data from the server.

I've looked through numerous code examples, through code, and I seem not to
be able, if you could point me in the right direction I'd really appreciate
it.
Joaquin Fernandez

Reply via email to