Subject: Re: problems on closing channel

Re: problems on closing channel

From: Peter <325131514_at_qq.com>
Date: Fri, 13 Sep 2013 17:00:09 +0800

Thanks for you reply.
 The command did not exit, and I want it to be exit, so I close the channel to end the command. BTW, I also read stderr after stdout. The situation is the same.
  
 Thanks




------------------ Original ------------------
From: "Peter Stuge";
Date: 2013年9月13日(星期五) 下午4:50
To: "libssh2-devel";
Subject: Re: problems on closing channel



Peter wrote:
> when cmd=ping (the address cannot be pinged) or other commands which
> output nothing. and then I make stop=true, the program would hangs at
> libssh2_channel_close(channel), and it always return LIBSSH2_ERROR_EAGAIN,
> so I cannot close the channel and cannot stop the command too.

The command has already exited on the server, but the channel stays
open until all data has been read. "output nothing" is true for
stdout, but probably the program has output to stderr, which you
have to also read using libssh2_channel_read_stderr().


//Peter
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
.

_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
Received on 2013-09-13