cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Question about using multi handle.

From: Stef Bon <stefbon_at_gmail.com>
Date: Tue, 2 Oct 2012 23:46:31 +0200

Hi,

thanks.
I've read futher and beginning to understand the interface, I've added
a multi_timer_cb function which does not more than logging:

fuse-workspace[3175]: OPENDIR
fuse-workspace[3175]: determine_fuse_path, name: ftp.kernel.org
fuse-workspace[3175]: determine_fuse_path, relpath 18 lenpath 18
fusepath FTP/ftp.kernel.org
fuse-workspace[3175]: ftp_direxpired
fuse-workspace[3175]: opendir_ftp
fuse-workspace[3175]: lookup_ftp_manager
fuse-workspace[3175]: opendir_ftp: set path to ftp://ftp.kernel.org/
fuse-workspace[3175]: multi_timer_cb: received timeout 1
fuse-workspace[3175]: opendir_ftp: return (0)
fuse-workspace[3175]: opendir, return 0
fuse-workspace[3175]: READDIR
fuse-workspace[3175]: ftp_readdir
fuse-workspace[3175]: ftp_readdir: A
fuse-workspace[3175]: ftp_readdir: B
fuse-workspace[3175]: ftp_readdir: C
fuse-workspace[3175]: ftp_readdir: timed out/expired
fuse-workspace[3175]: readdir, nreturn -110, bufpos 0
fuse-workspace[3175]: RELEASEDIR
fuse-workspace[3175]: ftp_closedir

My eventloop (I've created one myself which suits my app) has not yet
a timer functionality. With the timerfd_create function it's easy. I
have to add it first and test futher.

As you can see the timeout has value 1. This is milliseconds, so very
short. Is it normal to do these event direct or is it still normal to
add it to the eventloop, and than wait for 1 millisecond?

Stef

2012/10/2 Daniel Stenberg <daniel_at_haxx.se>:
> On Tue, 2 Oct 2012, Stef Bon wrote:
>
>> When doing a opendir, my fs adds the curl handle to the multi handle using
>> curl_multi_add_handle.
>>
>> The socket callback is defined, but it's never called. So the socket
>> action is never done,
>
>
> That seems strange, but I would guess that you possibly haven't fully
> understood the multi_socket API as it isn't the simplest thing out there.
>
>
>> I'm not using the CURLMOPT_TIMERFUNCTION, is this required?
>
>
> Not required, no, but you really need to know your way around the
> multi_socket API _first_ before you try to do without it. I'd strongly
> suggest you start out using it.
>
>
> --
>
> / daniel.haxx.se
> -------------------------------------------------------------------
> List admin: http://cool.haxx.se/list/listinfo/curl-library
> Etiquette: http://curl.haxx.se/mail/etiquette.html
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2012-10-02