|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2013-04-23 10:05 UTC] andrey dot kalinovsky at gmail dot com
Description:
------------
Event::add does not work on file descriptors obtained from fopen (or tmpfile). Bug
seen on linux only, works perfectly fine on Mac OSX.
Test script:
---------------
<?php
$base = new EventBase();
$file = tmpfile();
$event = new Event($base, $file, Event::READ | Event::PERSIST, function()
{
echo "test";
});
$event->add();
$base->loop();
Expected result:
----------------
test
Actual result:
--------------
PHP Notice: Event::add(): Epoll ADD(4) on fd 6 failed. Old events were 0; read
change was 0 (none); write change was 1 (add): Operation not permitted in
/home/andrey/react/test.php on line 11
PHP Stack trace:
PHP 1. {main}() /home/andrey/react/test.php:0
PHP 2. Event->add() /home/andrey/react/test.php:11
PHP Warning: Event::add(): Failed adding event in /home/andrey/react/test.php on
line 11
PHP Stack trace:
PHP 1. {main}() /home/andrey/react/test.php:0
PHP 2. Event->add() /home/andrey/react/test.php:11
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 09:00:01 2025 UTC |
Whoops, I haven't pasted the right version of the test script. Here it is: <?php $base = new EventBase(); $file = tmpfile(); $event = new Event($base, $file, Event::WRITE, function() { echo "test"; }); $event->add(); $base->loop();