-
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
1 changed file
with
8 additions
and
5 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 Service library for php 5.3+ * | ||
* * | ||
* LastModified: Aug 8, 2016 * | ||
* LastModified: Aug 10, 2016 * | ||
* Author: Ma Bingyao <[email protected]> * | ||
* * | ||
\**********************************************************/ | ||
|
@@ -294,11 +294,14 @@ public function error($server, $socket, $ex) { | |
$this->close($socket, $context); | ||
} | ||
private function timeout() { | ||
$deadlines = $this->deadlines; | ||
if (empty($deadlines)) { | ||
return 3600; | ||
if (empty($this->deferTasks)) { | ||
$deadlines = $this->deadlines; | ||
if (empty($deadlines)) { | ||
return 3600; | ||
} | ||
return max(0, min($deadlines) - microtime(true)); | ||
} | ||
return max(0, min($deadlines) - microtime(true)); | ||
return 0; | ||
} | ||
public function handle($servers) { | ||
$readableSockets = &$this->readableSockets; | ||
|