Jean-Louis CHARTON wrote:
> rc = libssh2_session_startup(session, sock);
> if (rc) {
>   error ...
> }
..
> but since we are in non blocking mode, I believe the code should be:
> 
> do {
>   rc = libssh2_session_startup(session, sock);
> } while (rc == LIBSSH2_ERROR_EAGAIN);
> 
> if (rc) {
>    error ...
> }

I disagree. I would treat the simple examples as just that - very
simple examples of how to call the library.

Different apps will likely want to handle different return codes in
different ways - especially when using nonblocking.

Rather than busywaiting on EAGAIN I think it would be better to set
the socket blocking before that call, and then set it nonblocking
again upon return - for the applications that want to use
nonblocking.


//Peter

------------------------------------------------------------------------------
_______________________________________________
libssh2-devel mailing list
libssh2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libssh2-devel

Reply via email to