php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #73941 pg_socket : Bad file descriptor
Submitted: 2017-01-15 05:49 UTC Modified: 2021-08-11 12:36 UTC
From: amereii at rooyekhat dot co Assigned: cmb (profile)
Status: Duplicate Package: event (PECL)
PHP Version: 7.0.14 OS: CentOS release 6.8 (Final)
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
40 - 12 = ?
Subscribe to this entry?

 
 [2017-01-15 05:49 UTC] amereii at rooyekhat dot co
Description:
------------
I want to add read event to pg_socket with event extension both don't accept resource of pg_socket but stream_select works well

For simplicity I write test script with well known library called reactphp/event-loop


if you run test script using event extension , this warning shown and there is no read event 

PHP Warning:  Event::add(): Epoll ADD(1) on fd 30584288 failed. Old events were 0; read change was 1 (add); write change was 0 (none); close change was 0 (none): Bad file descriptor in vendor/react/event-loop/src/ExtEventLoop.php on line 259
PHP Warning:  Event::add(): Failed adding event in vendor/react/event-loop/src/ExtEventLoop.php on line 259


Test script:
---------------
$loop = React\EventLoop\Factory::create();
$connection = pg_connect("host=localhost port=5432 dbname=mary");
$socket = pg_socket($connection);
$loop->addReadStream($socket , function (){
  echo "READ EVENT\n";
});

pg_send_query($connection , "select * from authors;");


Actual result:
--------------
PHP Warning:  Event::add(): Epoll ADD(1) on fd 30584288 failed. Old events were 0; read change was 1 (add); write change was 0 (none); close change was 0 (none): Bad file descriptor in vendor/react/event-loop/src/ExtEventLoop.php on line 259
PHP Warning:  Event::add(): Failed adding event in vendor/react/event-loop/src/ExtEventLoop.php on line 259


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2021-08-11 12:36 UTC] cmb@php.net
-Status: Open +Status: Duplicate -Assigned To: +Assigned To: cmb
 [2021-08-11 12:36 UTC] cmb@php.net
Duplicate of bug #73903.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 20:01:29 2024 UTC