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

Re: ssh_select possible improvement?


On Sunday, September 19, 2010 18:38:20 you wrote:
> Hi,

Hi Vic,

> Recently I just noticed that when I use libssh to establish a ssh shell
> connection to the server, key strokes have a latency. I checked the code
> and was able to confirm that this is ssh_select() problem.

well the ssh_select functions is something we ignored for a long time and we 
still try to avoid it. It has more bugs than what you describe. I suggest to 
use channel_poll() instead.

> The scenario is that: I have a local file descriptor from a terminal pty
> (which receives key strokes) and a ssh channel (which receives data from
> server). This is a very typical ssh shell session. So I pass the fd and
> the channel to ssh_select() with 1 second timeout. However, if I press a
> key, ssh_select will not return immediately, but will only return until
> the timeout is passed. If I set timeout to 10 seconds, I will get a huge
> latency.
> 
> I am using 0.4.5 (debian squeeze) version, but if you think 0.4.6 could
> make any difference, I can try. Please give me some hint before I
> actually dig into it. Thanks.

Nobody touched this code since a long time. I think it needs to be rewritten 
completely cause it misses a lot of things.

Could you use channel_poll()?


	-- andreas


Follow-Ups:
Re: ssh_select possible improvement?Vic Lee <llyzs@xxxxxxx>
Re: ssh_select possible improvement?Norbert Kiesel <nkiesel@xxxxxxxxxxxxxxx>
References:
ssh_select possible improvement?Vic Lee <llyzs@xxxxxxx>
Archive administrator: postmaster@lists.cynapses.org