www.libssh2.org | Daily snapshots | Mailing list archive | Docs | Examples | github

Archive Index This month's Index

Subject: Re: problem with big data packages using libssh2_channel_read

Re: problem with big data packages using libssh2_channel_read

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Mon, 21 Feb 2011 23:30:01 +0100 (CET)

On Mon, 21 Feb 2011, Mateusz Pilski wrote:

> I'm using libssh2 library to produce ssh client witch is designed for my
> clients needs. So far everything was working well, but i discovered that the
> program hangs for few seconds on large data packages.

Using the API in blocking mode, right?

My hunch is that what you're seeing is simply that while receiving a block of
data over a slow network link, then libssh2 will keep returning EAGAIN
internally and the blocking API will sit there waiting for a full packet to
arrive before it returns anyway.

If you really want to avoid that the function blocks for a certain period of
time at some invokes, I think you should consider the non-blocking approach.

Or do you think it can be something else?

-- 
  / daniel.haxx.se
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
Received on 2011-02-21

the libssh2 team