Skip to content

Commit

Permalink
Fixed #79
Browse files Browse the repository at this point in the history
  • Loading branch information
andot committed Apr 24, 2018
1 parent f46c43e commit b0f9b68
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/Hprose/Socket/FullDuplexTransporter.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* *
* hprose socket FullDuplexTransporter class for php 5.3+ *
* *
* LastModified: Jan 14, 2014 *
* LastModified: Apr 24, 2018 *
* Author: Ma Bingyao <[email protected]> *
* *
\**********************************************************/
Expand Down Expand Up @@ -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);
}
Expand Down
4 changes: 2 additions & 2 deletions src/Hprose/Socket/HalfDuplexTransporter.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* *
* hprose socket HalfDuplexTransporter class for php 5.3+ *
* *
* LastModified: Jan 14, 2018 *
* LastModified: Feb 24, 2018 *
* Author: Ma Bingyao <[email protected]> *
* *
\**********************************************************/
Expand Down Expand Up @@ -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) {
Expand Down
12 changes: 6 additions & 6 deletions src/Hprose/Socket/Transporter.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* *
* hprose socket Transporter class for php 5.3+ *
* *
* LastModified: Jan 14, 2018 *
* LastModified: Apr 24, 2018 *
* Author: Ma Bingyao <[email protected]> *
* *
\**********************************************************/
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit b0f9b68

Please sign in to comment.