Subject: Re: Get rid of get_socket_nonblocking ?

Re: Get rid of get_socket_nonblocking ?

From: Daniel Stenberg <>
Date: Mon, 19 Apr 2010 23:21:06 +0200 (CEST)

On Mon, 19 Apr 2010, Jose Baars wrote:

> The stack supports setting blocking and nonblocking on a socket, as one
> would expect, only querying the socket is impossible, I decided after
> several hours of trying.
> Examining the code of session .c, I found that this function is only called
> in session startup.

libssh2 uses only non-blocking sockets internally, and the idea is to remember
the state so that when you stop using libssh2 on the socket it would bring it
back to the previous state. I'm not convinced that's a feature anyone really
cares about.

> 600 session->socket_prev_blockstate = session->api_block_mode;
> 601 session_nonblock(session->socket_fd, 1);
> Three questions:
> 1. Are there any thinkable circumstances this would fail?

No, it should make libssh2 work fine, it just can't restore the state to what
it was before.

> 3. Or should I give up in trying to get libssh2 to work on the Multinet
> TCP/IP stack?

If this is your only hurdle, then certainly not! We can always add conditional
code to allow even such libs to play libssh2.

Received on 2010-04-19