From:             sebastian dot forsman at gmail dot com
Operating system: Linux 2.4.28
PHP version:      5.0.5
PHP Bug Type:     Sockets related
Bug description:  Ticks aren't run when PHP is blocking

Description:
------------
I am not sure if this is a bug or a 'feature', but when PHP is blocking,
registered tick functions aren't run. It also delays handling of the Unix
signals (which use ticks).

Reproduce code:
---------------
http://pastebin.com/375512

Expected result:
----------------
(You need Linux, posix-, pcntl- and socket-functions to run the script.)
The code snippet will start a simple single-client server. Try sending a
"kill <pid>" from the shell to the process. It won't react to the signal
in any way, until a connection is received (try "telnet localhost
22500").

Same applies to registered tick functions. If you modify the code and
register a tick function, it is not run at all when socket_accept() is
waiting for a connection.

Yes of course you can set the socket non-blocking, but then you are
missing the point.


-- 
Edit bug report at http://bugs.php.net/?id=34654&edit=1
-- 
Try a CVS snapshot (php4):   http://bugs.php.net/fix.php?id=34654&r=trysnapshot4
Try a CVS snapshot (php5.0): 
http://bugs.php.net/fix.php?id=34654&r=trysnapshot50
Try a CVS snapshot (php5.1): 
http://bugs.php.net/fix.php?id=34654&r=trysnapshot51
Fixed in CVS:                http://bugs.php.net/fix.php?id=34654&r=fixedcvs
Fixed in release:            http://bugs.php.net/fix.php?id=34654&r=alreadyfixed
Need backtrace:              http://bugs.php.net/fix.php?id=34654&r=needtrace
Need Reproduce Script:       http://bugs.php.net/fix.php?id=34654&r=needscript
Try newer version:           http://bugs.php.net/fix.php?id=34654&r=oldversion
Not developer issue:         http://bugs.php.net/fix.php?id=34654&r=support
Expected behavior:           http://bugs.php.net/fix.php?id=34654&r=notwrong
Not enough info:             
http://bugs.php.net/fix.php?id=34654&r=notenoughinfo
Submitted twice:             
http://bugs.php.net/fix.php?id=34654&r=submittedtwice
register_globals:            http://bugs.php.net/fix.php?id=34654&r=globals
PHP 3 support discontinued:  http://bugs.php.net/fix.php?id=34654&r=php3
Daylight Savings:            http://bugs.php.net/fix.php?id=34654&r=dst
IIS Stability:               http://bugs.php.net/fix.php?id=34654&r=isapi
Install GNU Sed:             http://bugs.php.net/fix.php?id=34654&r=gnused
Floating point limitations:  http://bugs.php.net/fix.php?id=34654&r=float
No Zend Extensions:          http://bugs.php.net/fix.php?id=34654&r=nozend
MySQL Configuration Error:   http://bugs.php.net/fix.php?id=34654&r=mysqlcfg

Reply via email to