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

Help With Reading Output Data


I'm just starting my use of libssh and am having problems reading output from an executed command. I've read the docs & tutorials but haven't found anything to address my problems.

My basic sequence goes like this:

1: connect & auth
2: ssh_channel_new, ssh_channel_open_session, ssh_channel_request_exec
3: loop on ssh_channel_read_nonblocking to read all output resulting from starting the command
4: ssh_channel_write to send some input to the command. this results in the command generating some output response
5: loop on ssh_channel_read_nonblocking to read all output resulting from starting the command

The problem is that at #5 there is no output data. If I sleep for 3 seconds before reading the output then I get the output that I already read at #3.

What am I doing wrong with this basic scenario?

-Wes


Follow-Ups:
Re: Help With Reading Output DataAndreas Schneider <asn@xxxxxxxxxxxxxx>
Re: Help With Reading Output DataAndreas Schneider <asn@xxxxxxxxxxxxxx>
Archive administrator: postmaster@lists.cynapses.org