Replies: 1 comment 1 reply
-
Thanks for question. Actually nobody can answer this. The library was developed by many people for more than 10 years without any clear vision or design. The code itself acts as documentation in our case. Some might say the timeout is only for one chunk of data, others - for whole data frame. I think we should focus on the real purpose of these timeouts and adjust code accordingly. Timeout handling is messy right now and any changes must be evaluated having big picture in mind. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I was looking at the timeout handling in https://github.com/php-amqplib/php-amqplib/blob/master/PhpAmqpLib/Wire/IO/SocketIO.php#L226
With regards to timout handling the code basically looks like this:
I don't understand why $write_Start is updated here:
$this->last_write = $write_start = $now;
.The result is that as long as a single byte is transferred within
$this->write_timeout
seconds, no timeout occurs.If this is the intended behaviour, the check in line 229 (
if (($now - $write_start) > $this->write_timeout)
) can just use$this->last_write
and the variable$write_start
can be removed.However I expected the write_timeout to be for the entire call to write(). And this would be the result if only
$this->last_write
was updated in line 226 (and$write_start
kept at the initial value).I could not find any previous discussions about this topic. What is the intended behaviour?
Best regards,
Søren Thing
PS: Thank you for your work on this project!
Beta Was this translation helpful? Give feedback.
All reactions