php / php/php-src

Add curl_multi_fdset to PHP cURL extension

Aperta
#19,576 5 commenti 0 reazioni 1 assegnatario Vedi su GitHub

@krakjoe ci sta già lavorando.

Dal 30/8/2025.

Extension: curl Feature Status: Verified
Lingua principale
C
Stelle
40.4k
Fork
8.1k
Merge medio
2g 13h
PR unite (30g)
96

Descrizione

Description

The binding for curl_multi_fdset() (available in libcurl C API) is missing.

This creates a limitation:

  • In libcurl (C), developers can extract the underlying sockets and integrate them into a single event loop with other file descriptors (e.g. database sockets, custom UDP/TCP sockets, message queues, etc.) using select(), poll(), or epoll().
  • In PHP, it is not possible: we only have curl_multi_select(), which is isolated and works exclusively for cURL sockets.

Many PHP applications combine multiple asynchronous sources:

  • HTTP requests via cURL multi-handle
  • Database connections (PostgreSQL via pg_socket())
  • Custom sockets (e.g. UDP for inter-process communication)

Proposed:

curl_multi_fdset(CurlMultiHandle $mh, array &$read, array &$write, array &$except): int

Where:
$read, $write, $except are arrays of PHP stream resources corresponding to the fds returned by libcurl.
Return value is the max_fd (as in libcurl).

Example:

$read = [$pg_socket, $udp_socket];
$write = [];
$except = [];

curl_multi_fdset($mh, $read, $write, $except);
stream_select($read, $write, $except, $timeout);

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.