Subject: Re: libssh2_channel_close/libssh2_channel_free hangs if you execute long-running command

Re: libssh2_channel_close/libssh2_channel_free hangs if you execute long-running command

From: Peter Stuge <peter_at_stuge.se>
Date: Fri, 14 Oct 2011 03:49:51 +0200

Pavel Strashkin wrote:
> Here we go. I read first block of data, then command "sleeps" for a
> [interval] seconds, i do libssh2_channel_close or
> libssh2_channel_free, and it hangs for [interval] seconds. I can't
> close channel or session graceful.

Of course not, when the remote program still has the channel open?

> As a workaround i do close on a socket directly before closing
> channel/session.

A proper solution would of course be to first kill the remote
program. Maybe you will not bother.

//Peter
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
Received on 2011-10-14