Repository navigation
Reads and writes with a zero timeout need to be non-blocking. - #6293
NathanFreeman wants to merge 1 commit into
Conversation
|
Thanks for the fix. Please address the following issues before merging. 1. Preserve native PHP behavior for zero-timeout writesFor a blocking TCP stream with
In Please keep the immediate write attempt, but preserve native PHP's failure return and timeout state when a blocking zero-timeout write cannot proceed. Explicitly non-blocking streams should retain their zero-byte-write behavior. See PHP's socket stream write implementation. 2. Make the write regression test actually reach a full send bufferThe current test writes only 1 MiB once. On my machine, all 1 MiB was written immediately, so the test never exercised the full-buffer condition. Its assertion also accepts Please fill the buffer in non-blocking mode until no further bytes can be written, then switch back to blocking mode, set the zero timeout, and verify the write result, Please also replace the fixed 10-second server sleep with explicit synchronization, and bound the polling loop in the read test so that a regression cannot hang the test indefinitely. The read-side approach is consistent with native PHP. The four new tests and the existing coroutine timeout test passed in my Linux / PHP 8.4 build, but the additional native-PHP comparison exposed the write-side gap above. |
No description provided.