-
Notifications
You must be signed in to change notification settings - Fork 8k
ext/sockets: adding Linux's TCP_USER_TIMEOUT constant. #20708
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
base: master
Are you sure you want to change the base?
Conversation
|
I see what is happening and why it fails on release 64 bits, the code block is in the wrong place. You just need to move it up in the IPPROTO_TCP section (~line 2082) |
I've moved it up to the IPPROTO_TCP block, I've also followed the setting of the option per the other two options in the IPPROTO_TCP block |
| socket_set_block($socket); | ||
|
|
||
| try { | ||
| socket_setopt($socket, SOL_TCP, TCP_USER_TIMEOUT, -1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: now I see it s working, please add a test with a large number (e.g. PHP_INT_MAX)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
after that, that will be all :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How do I account for differences in 32-bit and 64-bit PHP versions. PHP_INT_MAX will be less than UINT_MAX on 32-bit versions
UINT_MAX 4294967295
PHP_INT_MAX (32-bit) 2147483647
PHP_INT_MAX (64-bit) 9223372036854775807
I know we can test for PHP_INT_MAX = 4 and skip the check, however unsure how I would then handle the missing output in 32-bit EXPECTF (seperate test case?)
Useful to ensure PHP sockets are notified of socket failure when Sockets may be closed incorrectly and data can no longer be transmitted. eg Firewall dropping connection or peer device failure (commonly seen with Cloud load balancers).
From tcp(7) :It specifies the maximum amount of time in milliseconds that transmitted data may remain unacknowledged, or buffered data may remain untransmitted (due to zero window size) before TCP will forcibly close the corresponding connection and return ETIMEDOUT to the application.
Following #13816 for PR format for socket constants/