Skip to content

Commit 94ef249

Browse files
kelunikjsor
authored andcommitted
Fix LibEvLoop to ignore double IO streams
1 parent a86fae2 commit 94ef249

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
@@ -35,6 +35,10 @@ public function __construct()
3535
*/
3636
public function addReadStream($stream, callable $listener)
3737
{
38+
if (isset($this->readEvents[(int) $stream])) {
39+
return;
40+
}
41+
3842
$callback = function () use ($stream, $listener) {
3943
call_user_func($listener, $stream, $this);
4044
};
@@ -50,6 +54,10 @@ public function addReadStream($stream, callable $listener)
5054
*/
5155
public function addWriteStream($stream, callable $listener)
5256
{
57+
if (isset($this->writeEvents[(int) $stream])) {
58+
return;
59+
}
60+
5361
$callback = function () use ($stream, $listener) {
5462
call_user_func($listener, $stream, $this);
5563
};

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