-
Notifications
You must be signed in to change notification settings - Fork 390
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
10 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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]> * | ||
* * | ||
\**********************************************************/ | ||
|
@@ -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); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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]> * | ||
* * | ||
\**********************************************************/ | ||
|
@@ -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) { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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]> * | ||
* * | ||
\**********************************************************/ | ||
|
@@ -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) { | ||
|