Skip to content

Commit b2acd81

Browse files
committed
Fix LibEvLoop to ignore double IO streams
1 parent 7dc3006 commit b2acd81

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/LibEvLoop.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ public function __construct()
3838
*/
3939
public function addReadStream($stream, callable $listener)
4040
{
41+
if (isset($this->readEvents[(int) $stream])) {
42+
return;
43+
}
44+
4145
$callback = function () use ($stream, $listener) {
4246
call_user_func($listener, $stream, $this);
4347
};
@@ -53,6 +57,10 @@ public function addReadStream($stream, callable $listener)
5357
*/
5458
public function addWriteStream($stream, callable $listener)
5559
{
60+
if (isset($this->writeEvents[(int) $stream])) {
61+
return;
62+
}
63+
5664
$callback = function () use ($stream, $listener) {
5765
call_user_func($listener, $stream, $this);
5866
};

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy