cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re:FORGOT Libcurl Multi-Environment Timing Problems

From: Paul Romero <paulr_at_rcom-software.com>
Date: Fri, 09 Jul 2010 12:54:07 -0700

Hi Daniel:

I forgot to address one of the issues you mentioned.
My program can not afford to block during slow operations
because it needs to be able to respond to asynchronous
events at any time.

Best Regards,

Paul R.

************* PREVIOUS MESSAGE *****************88

Hi Daniel:

Thank you for your replies.

Daniel Stenberg wrote:

> On Thu, 8 Jul 2010, Paul Romero wrote:
>
> > I can successfully send a single file via SFTP in the libcurl multi
> > environment. The basic technique, is to call curl_multi_perform() and
> > curl_multi_info_read() when Linux SIGIO occurs.
>
> Whoa, that sounds like you're on your own then. That's not how we make the API
> work and how thousands of users already made us of it successfully.
>

I think the library is a powerful tool and quite stable ! Also, I do
not
absolutely
use that particular technique. Of course, I would like to insulate my
other
code from the library scheduling details.

> > The Linux socket is programmed for asynchronous IO and generates SIGIO
> > whenever input or output to the socket is possible. (i.e. The standard
> > fcntl() technique is used to configure the socket.)
>
> It may be standard but it's not how you typically use libcurl.
>
> > However, a few kludges are necessary to make the technique work. The one
> > that disturbs me is that a 20 MS delay must be added prior to calling
> > curl_multi_perform(). The details are described below. This technique is
> > important to me because my target environment does not have libevent.
>
> I'm sorry, but that sentense doesn't parse for me.
>
> If you use curl_multi_perform() you don't want/need libevent. If you want
> libevent-style processing, you don't use curl_multi_perform().
>

OK, I believe you. What alternative routine do you suggest which does
not rely upon the libevent library and FIFOs ?

>
> Instead of describing your problem, can you please tell us what you're trying
> to accomplish and why just using the multi interface the regular way isn't
> good enough?
>

What I am trying to do is fairly simple and perhaps the sophistication
of the
examples has confused me. Here is what I am trying to do.

1) Send a single file between my system and another via SFTP.
2) Perform the transaction asynchronously so that my program
    can do other things during the file transfer.

Ideally, it would be possible to invoke a routine to start the
file transfer, and a handler indicating the outcome would
execute when it is complete. However, that may not be a
reasonable expectation. I would expect the library has
some way to inform a program when data can be sent
and the program needs some code to respond to the
notification.

Best Regards,

Paul R.

>
> --
>
> / daniel.haxx.se
> -------------------------------------------------------------------
> List admin: http://cool.haxx.se/list/listinfo/curl-library
> Etiquette: http://curl.haxx.se/mail/etiquette.html

--
Paul Romero
RCOM Communications Software
Phone/Fax: (510)339-2628
E-Mail: paulr_at_rcom-software.com
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2010-07-09