Subject: Re: libssh2_poll_channel_read() is deprecated?

Re: libssh2_poll_channel_read() is deprecated?

From: Peter Stuge <peter_at_stuge.se>
Date: Mon, 17 May 2010 13:21:27 +0200

Ishaan Gulrajani wrote:
> But It doesn't really explain the difference between blocking and
> non-blocking mode.

Blocking and non-blocking behaves exactly the same as blocking and
non-blocking I/O normally does on a socket or file descriptor.

If you are not familiar with these concepts then you need to show the
courtesy of spending some time with your favorite search engine to
learn about them. Some of the first hits on Google are:

http://en.wikipedia.org/wiki/Asynchronous_I/O
http://www.developerfusion.com/article/28/introduction-to-tcpip/8/
http://www.kegel.com/dkftpbench/nonblocking.html

..and there are of course many more good pages on the topic, along
with any and all references that are listed on those pages.

> Could you please explain or point me to the right example?

No. You did not explain one single thing about what you want so you
have made it impossible for anyone to help you.

Since your fake code (show *the actual* code that you use) did not
clearly demonstrate what your assumptions and preferences with regard
to the use of libssh2 are, I guessed that you want blocking behavior.

I said that you should look at *any* example to find out how to read
data, but that since you seem to want blocking behavior you should
not pick any of the _nonblock examples.

You have provided no new information but only asked me again to point
to an example, so I will answer exactly the same as before:

Look at any example except the _nonblock ones.

I would pick the smallest one. I would experiment, and I would try to
learn. If you have tried that and run into some trouble, then you
need to explain what you tried, what you expected, what happened, and
your idea about why it did not work as you expected if you want any
help.

//Peter
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
Received on 2010-05-17