poll (2) - portability/alternatives

From: Date: Mon, 18 Mar 2002 22:39:38 +0000
Subject: poll (2) - portability/alternatives
Groups: php.dev 
Request: Send a blank email to php-dev+get-81463@lists.php.net to get a copy of this message
Theres a bug in the DB where feof($sock) will not detect a timed-out connection. I have a fix which uses poll(2) if available to check if the socket has hungup. If poll(2) is not present, it will try to read a chunk of data; if that times out or sets the eof indicator, then an EOF is returned. Does anyone know just how portable poll(2) is, and if there is an alternative portable technique to check if the sock is still connected? My man page says that libc emulates poll(2) in older linux kernels using select(); can anyone point me to some code that does this using select()? --Wez.

« previous php.dev (#81463) next »