cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Need clarification for multi_socket interface with epoll() API

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Thu, 14 Jul 2016 23:18:36 +0200 (CEST)

On Wed, 13 Jul 2016, smruti kumari wrote:

> If I want to send one more get/post message to same/different link using
> same easy handle, whether it possible or not since socket fd is closed for
> the easy handle.

If you want to do more transfers, you remove the easy handle from the multi
handle, set new options (if any), and then add it again. That will then start
another transfer using the same easy handle.

> Do I need to call curl_multi_socket_action() API with CURL_SOCKET_TIMEOUT
> option before sending one more data using same curl easy handle ?

No, that was just the one first time to kick-start everything. After that
first start, it'll keep running on its own.

> I have observed that after 7th If I will call curl_multi_socket_action() API
> to send data then it is not calling the socketCallback() API.

If it doesn't call the socket callback with updated information, you should
keep waiting for the same sockets and actions.

> If available please provide the example link for epoll() API with curl's
> multi_socket interface.

We provide examples using several different event libraries, I don't think we
have one that uses epoll directly. Mostly people try to avoid that since it
makes the application Linux specific.

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
List admin: https://cool.haxx.se/list/listinfo/curl-library
Etiquette:  https://curl.haxx.se/mail/etiquette.html
Received on 2016-07-14