Skip Menu |

This queue is for tickets about the Net-SSH2 CPAN distribution.

Report information
The Basics
Id: 43476
Status: rejected
Priority: 0/
Queue: Net-SSH2

People
Owner: Nobody in particular
Requestors: jhoger [...] pobox.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: (no value)
Fixed in: (no value)



Subject: Channel objects do not work with select: no FILENO method
In attempting to use IO::Select on a Net::SSH2::Channel object I get the following error: "Can't locate object method "FILENO" via package "Net::SSH2::Channel" at /usr/local/lib/perl/5.8.8/IO/Select.pm line 61." I understand that there is a poll() method on Net::SSH2 and am going to look at that next. But it would be nice if select worked since I'm more familiar with it. I don't know how much work it would be to add... I guess it depends on whether fileno can be derived via the libssh2 api.
Unfortunately, channels are not backed by real (at the operating system level) file descriptors and as so, they can not be passed to functions expecting such. Having said that, you can select on the socket running the SSH connection. See the 'block_directions' method. The development version on GitHub also provides the Channel methods window_read and window_write that allow to check how much data is available for reading and how much can be written without overflooding the remote side. Then, the deprecated 'poll' Channel method is still available.