Subject: Re: [ libssh2-Bugs-2558794 ] libssh2_poll returns 0 sometimes when using select

Re: [ libssh2-Bugs-2558794 ] libssh2_poll returns 0 sometimes when using select

From: Heiner Steven <heiner.steven_at_nexgo.de>
Date: Wed, 15 Apr 2009 16:54:53 +0200

Daniel Stenberg wrote:
> On Wed, 15 Apr 2009, Heiner Steven wrote:
>
>>> I'm now advocating we deprecate libssh2_poll() completely.
>>>
>>> Is there any reason why you don't just use poll() or select() on the socket
>>> libssh2 operates on?
>> According to the manual page libssh2_poll() seems to be just a
>> platform-independant wrapper to poll(2)/select(2).
>
> Right, and I don't think that's a job for libssh2.
>
>> We could, however, add some additional value to that function: it could
>> return whether a *complete SSH message* has been read or even if *SSH data*
>> is available for libssh2_channel_read_ex().
>
> Uhm, yes we could but why?

Maybe I'm just paranoid, but what happens if data is available,
but it's not a complete SSH message? Would the libssh2_* functions
just fail with EWOULDBLOCK?

> Such an application would rather just use non-blocking sockets, call poll()
> and then call libssh2_channel_read_ex(). It's really simple already. Isn't it?
>
> Besides, such fundamental change would be an ABI/API breakage so it would need
> to be a new function anyway.

Agreed, we could not reuse the function libssh2_poll().

Heiner

------------------------------------------------------------------------------
This SF.net email is sponsored by:
High Quality Requirements in a Collaborative Environment.
Download a free trial of Rational Requirements Composer Now!
http://p.sf.net/sfu/www-ibm-com
_______________________________________________
libssh2-devel mailing list
libssh2-devel_at_lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libssh2-devel
Received on 2009-04-15