[paramiko] SSHClient and timeouts
Mike McGrath
mmcgrath at fedoraproject.org
Fri Oct 13 12:04:38 PDT 2006
On 10/13/06, Robey Pointer <robey at lag.net> wrote:
>
> On 9 Oct 2006, at 7:45, Mike McGrath wrote:
>
> > Is there any way to set a timeout while using SSHClient?
>
> If you're using invoke_shell(), the returned object is a Channel, so
> you can call set_timeout() on it.
>
> If you're using exec_command(), it's less obvious: The returned file
> objects have a "channel" attribute that you can use to access the
> underlying channel, and set a timeout that way.
so we're looking at something similar to:
stdin, stdout, stderr = session.exec_command('blah")
stdin.timeout(5)
stdout.timeout(5)
stderr.timeout(5)
?
-Mike
More information about the paramiko
mailing list