Subject: Re: Blocking/non-blocking and session disconnect

Re: Blocking/non-blocking and session disconnect

From: Paulo Caetano <paulo.a.o.caetano_at_gmail.com>
Date: Sun, 27 May 2012 17:17:25 +0100

> Don't reinvent the whell. This example and all others should just
> switch the session back to blocking mode if blocking behavior is
> desired, which I guess is the case since it is what is implemented
> above.

Good point. Something like this, then:

shutdown:
    libssh2_session_set_blocking(session, 1);

    libssh2_session_disconnect(session,
                               "Normal Shutdown, Thank you for playing");

    libssh2_session_free(session);

Shall I send a patch?

Thanks.
Paulo Caetano

On Sun, May 27, 2012 at 9:10 AM, Peter Stuge <peter_at_stuge.se> wrote:
> Paulo Caetano wrote:
>> AFAICT, blocking is still off, so shutdown should be like this:
>> ---
>> shutdown:
>>
>>     while (libssh2_session_disconnect(session, "Normal Shutdown, Thank
>> you for playing") == LIBSSH2_ERROR_EAGAIN)
>
> Don't reinvent the whell. This example and all others should just
> switch the session back to blocking mode if blocking behavior is
> desired, which I guess is the case since it is what is implemented
> above.
>
>
> //Peter
> _______________________________________________
> libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel

_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
Received on 2012-05-27