Subject: Re: Which events to poll in session_startup when non-blocking ?

Re: Which events to poll in session_startup when non-blocking ?

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Wed, 15 Jun 2011 22:58:06 +0200 (CEST)

On Wed, 15 Jun 2011, Rodolphe Rocca wrote:

> first of all, thank you for this good SSH library. That's a pretty good
> piece of software :-)

Thanks, it is truly a team effort and we do our best in making it good!

> while ((rc = libssh2_session_startup(session, sock)) ==

Let me first gently point out that we offer libssh2_session_handshake() now as
a replacement...

> LIBSSH2_ERROR_EAGAIN)
> {
> ps = poll(&fds, 1, timeout);
>
> if (ps == -1)
> {
> // handle error
> }
> else if (ps == 0)
> {
> // handle timeout
> }
> }
>
> The problem with this is that I do not know if I have to POLLIN or POLLOUT.
>
> What should I do ? Poll for both ?

Call libssh2_session_block_directions() and it'll tell you!

-- 
  / daniel.haxx.se
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
Received on 2011-06-15