From 8aabd17000848800de92ec8b1f16e5af884b3ada Mon Sep 17 00:00:00 2001 From: Niklas Keller Date: Sun, 17 Sep 2017 22:08:49 +0200 Subject: [PATCH] Fix PID reader --- lib/Internal/Windows/SocketConnector.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/Internal/Windows/SocketConnector.php b/lib/Internal/Windows/SocketConnector.php index bdd975d..4282d65 100644 --- a/lib/Internal/Windows/SocketConnector.php +++ b/lib/Internal/Windows/SocketConnector.php @@ -200,15 +200,15 @@ final class SocketConnector { } public function onReadableChildPid($watcher, $socket, Handle $handle) { - Loop::cancel($watcher); - Loop::cancel($handle->connectTimeoutWatcher); - $data = \fread($socket, 5); if ($data === false || $data === '') { return; } + Loop::cancel($watcher); + Loop::cancel($handle->connectTimeoutWatcher); + if (\strlen($data) !== 5) { $this->failHandleStart( $handle, 'Failed to read PID from wrapper: Received %d of 5 expected bytes', \strlen($data)