www.libssh2.org | Daily snapshots | Mailing list archive | Docs | Examples

Archive Index This month's Index

Subject: How to get file descriptor of channel?

How to get file descriptor of channel?

From: Pavel Strashkin <pavel.strashkin_at_gmail.com>
Date: Mon, 15 Aug 2011 17:30:59 -0700

Hello folks,

I've started using this very good library and first of i want to say
thanks. The second is i want to know the file descriptor of channel
(or whatever) which is used in select/poll so i could re-use it in my
own polling mechanism (don't ask why, we live in a world of many
libraries and many of them have own readable/writable watchers so i
just want to use one at the time, not all). Is there any way how can i
do it? I checked the public API and didn't find anything interesting.
The original problem comes from using of libnet-ssh2-perl which uses
250ms timeout for polling. 250ms is too much for me, moreover, i don't
want to wait for 250ms on every "read-call" just to check if there is
a data or not. I want to attach a file descriptor to some abstract
watcher, wait for "readable" event and read till the end or
EAGAIN/EWOULDBLOCK (whatever will happen first, it's just an example).

Thank you!
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
Received on 2011-08-16

the libssh2 team