amphp / process

An async process dispatcher for Amp.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SocketConnector fails to close sockets on PHP8/Win

Bilge opened this issue · comments

commented

This code is prone to throwing TypeErrors in PHP 8.0.3/Windows:

Fatal error: Uncaught TypeError: fclose(): supplied resource is not a valid stream resource in amphp\process\lib\Internal\Windows\SocketConnector.php:313
Stack trace:
#0 amphp\process\lib\Internal\Windows\SocketConnector.php(313): fclose(Resource id #176)
#1 amphp\amp\lib\Loop\NativeDriver.php(321): Amp\Process\Internal\Windows\SocketConnector->onReadableExitCode('t', Resource id #176, Object(Amp\Process\Internal\Windows\Handle))
#2 amphp\amp\lib\Loop\NativeDriver.php(127): Amp\Loop\NativeDriver->selectStreams(Array, Array, 4.963)