[paramiko] Using select() to determine when channel write buffer not full

Robey Pointer robey at lag.net
Mon Nov 19 21:26:05 PST 2007


On 13 Nov 2007, at 9:28, Dwayne Litzenberger wrote:

> Hi there!
>
> When working with a native socket, if I want to check if a send()  
> would not
> block, I can do something like this:
>
>    (rr, ww, ee) = select.select([], [sock], [], 0)
>
> That obviously doesn't work with Paramiko channels, since (from what  
> I can
> tell) the file descriptor returned by Channel.fileno() isn't  
> actually used
> for I/O.

Yeah, and it's only hooked up for detecting reads, not writes.


> Imagine that I want to copy data coming in at high speed over a  
> socket to a
> much slower Paramiko channel.  What I would like to do is something  
> like
> this, but it doesn't seem to be possible:

I guess what you really want is something like "send_ready()" that  
would behave similar to "recv_ready()": return True if at least one  
byte can be written.

Try the branch at revision 456 -- is that sufficient to do what you  
want?

robey




More information about the paramiko mailing list