From b0f9b68a07ec3a08a23c54592e54ab68972a9c33 Mon Sep 17 00:00:00 2001 From: andot Date: Tue, 24 Apr 2018 22:29:31 +0800 Subject: [PATCH] Fixed #79 --- src/Hprose/Socket/FullDuplexTransporter.php | 4 ++-- src/Hprose/Socket/HalfDuplexTransporter.php | 4 ++-- src/Hprose/Socket/Transporter.php | 12 ++++++------ 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/Hprose/Socket/FullDuplexTransporter.php b/src/Hprose/Socket/FullDuplexTransporter.php index 71732045..7ee5de5b 100644 --- a/src/Hprose/Socket/FullDuplexTransporter.php +++ b/src/Hprose/Socket/FullDuplexTransporter.php @@ -14,7 +14,7 @@ * * * hprose socket FullDuplexTransporter class for php 5.3+ * * * - * LastModified: Jan 14, 2014 * + * LastModified: Apr 24, 2018 * * Author: Ma Bingyao * * * \**********************************************************/ @@ -56,7 +56,7 @@ protected function asyncReadError($o, $stream, $index = -1) { } unset($o->queue[$stream_id]); unset($o->responses[$stream_id]); - fclose($stream); + @fclose($stream); $this->removeStream($stream, $o->readpool); $this->removeStream($stream, $o->writepool); } diff --git a/src/Hprose/Socket/HalfDuplexTransporter.php b/src/Hprose/Socket/HalfDuplexTransporter.php index 8384ca64..6be5975a 100644 --- a/src/Hprose/Socket/HalfDuplexTransporter.php +++ b/src/Hprose/Socket/HalfDuplexTransporter.php @@ -14,7 +14,7 @@ * * * hprose socket HalfDuplexTransporter class for php 5.3+ * * * - * LastModified: Jan 14, 2018 * + * LastModified: Feb 24, 2018 * * Author: Ma Bingyao * * * \**********************************************************/ @@ -43,7 +43,7 @@ protected function asyncReadError($o, $stream, $index) { $this->free($o, $index); } unset($o->responses[(integer)$stream]); - fclose($stream); + @fclose($stream); $this->removeStream($stream, $o->readpool); } protected function getBodyLength($stream) { diff --git a/src/Hprose/Socket/Transporter.php b/src/Hprose/Socket/Transporter.php index aa7cf6b0..c42e6c89 100644 --- a/src/Hprose/Socket/Transporter.php +++ b/src/Hprose/Socket/Transporter.php @@ -14,7 +14,7 @@ * * * hprose socket Transporter class for php 5.3+ * * * - * LastModified: Jan 14, 2018 * + * LastModified: Apr 24, 2018 * * Author: Ma Bingyao * * * \**********************************************************/ @@ -47,7 +47,7 @@ public function __construct(Client $client, $async) { $this->async = $async; } public function __destruct() { - if ($this->stream !== null) fclose($this->stream); + if ($this->stream !== null) @fclose($this->stream); } protected function getLastError($error) { $e = error_get_last(); @@ -104,7 +104,7 @@ protected function asyncWrite($stream, $o) { if ($sent === false) { $o->results[$request->index]->reject($this->getLastError('request write error')); $this->free($o, $request->index); - fclose($stream); + @fclose($stream); $this->removeStream($stream, $o->writepool); return; } @@ -149,7 +149,7 @@ private function asyncRead($stream, $o) { private function removeStreamById($stream_id, &$pool) { foreach ($pool as $index => $stream) { if ((integer)$stream == $stream_id) { - fclose($stream); + @fclose($stream); unset($pool[$index]); return; } @@ -276,8 +276,8 @@ public function loop() { $o->writepool = $this->createPool($client, $o); } } - foreach ($o->writepool as $stream) fclose($stream); - foreach ($o->readpool as $stream) fclose($stream); + foreach ($o->writepool as $stream) @fclose($stream); + foreach ($o->readpool as $stream) @fclose($stream); } } public function asyncSendAndReceive($buffer, stdClass $context) {