|
14 | 14 | * *
|
15 | 15 | * hprose socket Transporter class for php 5.3+ *
|
16 | 16 | * *
|
17 |
| - * LastModified: Jan 14, 2018 * |
| 17 | + * LastModified: Apr 24, 2018 * |
18 | 18 | * Author: Ma Bingyao <[email protected]> *
|
19 | 19 | * *
|
20 | 20 | \**********************************************************/
|
@@ -47,7 +47,7 @@ public function __construct(Client $client, $async) {
|
47 | 47 | $this->async = $async;
|
48 | 48 | }
|
49 | 49 | public function __destruct() {
|
50 |
| - if ($this->stream !== null) fclose($this->stream); |
| 50 | + if ($this->stream !== null) @fclose($this->stream); |
51 | 51 | }
|
52 | 52 | protected function getLastError($error) {
|
53 | 53 | $e = error_get_last();
|
@@ -104,7 +104,7 @@ protected function asyncWrite($stream, $o) {
|
104 | 104 | if ($sent === false) {
|
105 | 105 | $o->results[$request->index]->reject($this->getLastError('request write error'));
|
106 | 106 | $this->free($o, $request->index);
|
107 |
| - fclose($stream); |
| 107 | + @fclose($stream); |
108 | 108 | $this->removeStream($stream, $o->writepool);
|
109 | 109 | return;
|
110 | 110 | }
|
@@ -149,7 +149,7 @@ private function asyncRead($stream, $o) {
|
149 | 149 | private function removeStreamById($stream_id, &$pool) {
|
150 | 150 | foreach ($pool as $index => $stream) {
|
151 | 151 | if ((integer)$stream == $stream_id) {
|
152 |
| - fclose($stream); |
| 152 | + @fclose($stream); |
153 | 153 | unset($pool[$index]);
|
154 | 154 | return;
|
155 | 155 | }
|
@@ -276,8 +276,8 @@ public function loop() {
|
276 | 276 | $o->writepool = $this->createPool($client, $o);
|
277 | 277 | }
|
278 | 278 | }
|
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); |
281 | 281 | }
|
282 | 282 | }
|
283 | 283 | public function asyncSendAndReceive($buffer, stdClass $context) {
|
|
0 commit comments