Correction about pollfd.  Of course, it should be curl_waitfd as 
platform-independent representation of a pollfd-like structure.


-----Original Message-----
From: curl-library <curl-library-boun...@lists.haxx.se> On Behalf Of Dmitry 
Karpov via curl-library
Sent: Thursday, December 14, 2023 1:26 PM
To: libcurl development <curl-library@lists.haxx.se>
Cc: Dmitry Karpov <dkar...@roku.com>
Subject: [EXTERNAL] Question/proposal about function returning pollfds from 
multi handle

Hi All,

As we know, the multi handle API provides a useful curl_multi_fdset() function 
allowing to set descriptor bits for the sockets used by the multi handle, so, 
they can used in some external select() calls.

But currently there is no function that can provide a similar functionality 
(like array of pollfd structures) for external poll().
I think it would be useful to provide a function named something like 
"curl_multi_pollfds", which could have a signature like:

CURLMcode curl_multi_pollfds(struct pollfd *ufds, unsigned int max_nfds)

which will fill the provided array of pollfds up to max_nfds (it will return 
CURLM_OUT_OF_MEMORY if the number of descriptors is greater than the max size).

This function will be helpful to use with poll() to overcome the select() 
shortcomings.
(I don't think it will be difficult to add this function as the 
curl_multi_fdset() uses poll structures internally.)

What do you think?

Thanks,
Dmitry Karpov

--
Unsubscribe: https://lists.haxx.se/mailman/listinfo/curl-library
Etiquette:   https://curl.se/mail/etiquette.html
-- 
Unsubscribe: https://lists.haxx.se/mailman/listinfo/curl-library
Etiquette:   https://curl.se/mail/etiquette.html

Reply via email to