Dostupnost ve verzích: PHP 4.3.0
Runs the equivalent of the select() system call on the given
arrays of streams with a timeout specified by tv_sec and tv_usec
| Parametr | Datový typ | Výchozí hodnota | Poznámka |
|---|---|---|---|
$read |
array |
není | The streams listed in the read array will be watched to see if characters become available for reading (more precisely, to see if a read will not block - in particular, a stream resource is also ready on end-of-file, in which case an fread will return a zero length string). |
$write |
array |
není | The streams listed in the write array will be watched to see if a write will not block. |
$except |
array |
není | The streams listed in the except array will be watched for high priority exceptional ("out-of-band") data arriving. |
$tv_sec |
int |
není | The tv_sec and tv_usec together form the timeout parameter, tv_sec specifies the number of seconds while tv_usec the number of microseconds. The timeout is an upper bound on the amount of time that stream_select will wait before it returns. If tv_sec and tv_usec are both set to 0, stream_select will not wait for data - instead it will return immediately, indicating the current status of the streams. |
$tv_usec |
int |
null | See tv_sec description. |
int
On success stream_select returns the number of
stream resources contained in the modified arrays, which may be zero if
the timeout expires before anything interesting happens. On error false
is returned and a warning raised (this can happen if the system call is
interrupted by an incoming signal).
Autor článku pracuje jako seniorní vývojář a software architekt v Praze. Navrhuje a spravuje velké webové aplikace, které znáte a používáte. Od roku 2009 nabral bohaté zkušenosti, které tímto webem předává dál.
Rád vám pomůžu:
Pomohu vám zavést AI do vašeho projektu – od analýzy a návrhu řešení až po nasazení do produkce. Ušetřete čas, zjednodušte procesy a získejte konkurenční výhodu.
Domluvit konzultaciNabízím trénink vývojářů, konzultace, školení a analýzu návrhových vzorů. Osobně v Praze nebo online.
Napište miNejlepsi tipy a triky o PHP do Vaseho e-mailu. Clanky a novinky nejen ze sveta PHP a programovani.