With typical BSD sockets, if you do a read() and the other end hasn't written anything, read will block forever. With libssh2's channel_read, if the other end hasn't written anything, it doesn't block, it just returns 0 immediately, even after successive calls. (This is on OS X.)
So when exactly does channel_read block? I'm trying to determine exactly if when I should call read(). i.e., if I'm executing an arbitrary command from the user, if it's going to block because there is no output, I don't want to call it. Example: channel = libssh2_channel_open_session(session); libssh2_channel_set_blocking(channel, 1); libssh2_channel_exec(channel, "touch 'test.tmp'"); libssh2_channel_eof(channel); // 0 libssh2_channel_read(channel, buffer, bufferSize); // 0, no blocking libssh2_channel_eof(channel); // 1 libssh2_channel_read(channel, buffer, bufferSize); // 0, no blocking ... etc ... Reading the documentation and code for libssh2_channel_read_ex, it's not clear when it would return 0 versus actually block and wait until some bytes come through. Thanks, -- Seth Willits _______________________________________________ libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel