Skip to content

Conversation

@Reasno
Copy link
Contributor

@Reasno Reasno commented Feb 1, 2021

According to the document on wiki.swoole.com, the correct way to check disconnection is emtpy($buffer), instead of $buffer===false.

In our production environment, we periodically encounter infinite recv loops caused by the empty buffer. After the proposed change was made, the occasional dead loop went away.

According to the document on wiki.swoole.com, the correct way to check disconnection is emtpy($buffer), instead of $buffer===false. In our production environment, we periodically encounter infinite recv loops caused by the empty buffer. After the proposed change was made, the occasional dead loop went away.
@Yurunsoft
Copy link
Member

if $buffer === '0', it's wrong

@Reasno
Copy link
Contributor Author

Reasno commented Feb 1, 2021

if $buffer === '0', it's wrong

Then it should be $buffer == '' || $buffer === false

if $buffer === '0', it's wrong

maybe use $buffer === '' || $buffer === null || $buffer ===false

@Reasno
Copy link
Contributor Author

Reasno commented Feb 1, 2021

@Yurunsoft Yurunsoft merged commit 796953d into swoole:master Feb 1, 2021
Reasno added a commit to hyperf/hyperf that referenced this pull request Feb 4, 2021
@Reasno Reasno deleted the patch-4 branch February 4, 2021 05:15
limingxinleo pushed a commit to hyperf/hyperf that referenced this pull request Feb 5, 2021
huangzhhui pushed a commit to hyperf/kafka that referenced this pull request Feb 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants