Skip to content

Commit b0f9b68

Browse files
committed
Fixed #79
1 parent f46c43e commit b0f9b68

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

src/Hprose/Socket/FullDuplexTransporter.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* *
1515
* hprose socket FullDuplexTransporter class for php 5.3+ *
1616
* *
17-
* LastModified: Jan 14, 2014 *
17+
* LastModified: Apr 24, 2018 *
1818
* Author: Ma Bingyao <[email protected]> *
1919
* *
2020
\**********************************************************/
@@ -56,7 +56,7 @@ protected function asyncReadError($o, $stream, $index = -1) {
5656
}
5757
unset($o->queue[$stream_id]);
5858
unset($o->responses[$stream_id]);
59-
fclose($stream);
59+
@fclose($stream);
6060
$this->removeStream($stream, $o->readpool);
6161
$this->removeStream($stream, $o->writepool);
6262
}

src/Hprose/Socket/HalfDuplexTransporter.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* *
1515
* hprose socket HalfDuplexTransporter class for php 5.3+ *
1616
* *
17-
* LastModified: Jan 14, 2018 *
17+
* LastModified: Feb 24, 2018 *
1818
* Author: Ma Bingyao <[email protected]> *
1919
* *
2020
\**********************************************************/
@@ -43,7 +43,7 @@ protected function asyncReadError($o, $stream, $index) {
4343
$this->free($o, $index);
4444
}
4545
unset($o->responses[(integer)$stream]);
46-
fclose($stream);
46+
@fclose($stream);
4747
$this->removeStream($stream, $o->readpool);
4848
}
4949
protected function getBodyLength($stream) {

src/Hprose/Socket/Transporter.php

+6-6
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* *
1515
* hprose socket Transporter class for php 5.3+ *
1616
* *
17-
* LastModified: Jan 14, 2018 *
17+
* LastModified: Apr 24, 2018 *
1818
* Author: Ma Bingyao <[email protected]> *
1919
* *
2020
\**********************************************************/
@@ -47,7 +47,7 @@ public function __construct(Client $client, $async) {
4747
$this->async = $async;
4848
}
4949
public function __destruct() {
50-
if ($this->stream !== null) fclose($this->stream);
50+
if ($this->stream !== null) @fclose($this->stream);
5151
}
5252
protected function getLastError($error) {
5353
$e = error_get_last();
@@ -104,7 +104,7 @@ protected function asyncWrite($stream, $o) {
104104
if ($sent === false) {
105105
$o->results[$request->index]->reject($this->getLastError('request write error'));
106106
$this->free($o, $request->index);
107-
fclose($stream);
107+
@fclose($stream);
108108
$this->removeStream($stream, $o->writepool);
109109
return;
110110
}
@@ -149,7 +149,7 @@ private function asyncRead($stream, $o) {
149149
private function removeStreamById($stream_id, &$pool) {
150150
foreach ($pool as $index => $stream) {
151151
if ((integer)$stream == $stream_id) {
152-
fclose($stream);
152+
@fclose($stream);
153153
unset($pool[$index]);
154154
return;
155155
}
@@ -276,8 +276,8 @@ public function loop() {
276276
$o->writepool = $this->createPool($client, $o);
277277
}
278278
}
279-
foreach ($o->writepool as $stream) fclose($stream);
280-
foreach ($o->readpool as $stream) fclose($stream);
279+
foreach ($o->writepool as $stream) @fclose($stream);
280+
foreach ($o->readpool as $stream) @fclose($stream);
281281
}
282282
}
283283
public function asyncSendAndReceive($buffer, stdClass $context) {

0 commit comments

Comments
 (0)