Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add support to define write-timeout in ms #1517

Merged
merged 2 commits into from
Dec 14, 2020

Conversation

milos-silni
Copy link

No description provided.

@@ -368,7 +369,10 @@ private function writingIsTimedOut(int $sent): bool
usleep(100);
}

if ((time() - $this->lastWritingAt) >= $writingTimeout) {
// convert to ms
$lastWritingMs = (time() - $this->lastWritingAt) * 1000;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess this (and lastWritingAt) var should be based on microtime(true) and not time(). That'd make it more precise (because otherwise if you determine a write-timeout as 0.5, this code would anyway only timeout after a second has passed), and you would not have to multiply anything by 1000 anymore.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed this myself in 3ee78ae

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants