开发者

stream_select bug in PHP -- I can't change my php version, what alternatives or hacks can I do?

开发者 https://www.devze.com 2023-03-30 19:51 出处:网络
I am working on someone\'s server that only has PHP version 5.0.4. I am not permitted to update the PHP version at this time because they have some old programs, etc. that would need to be c开发者_Sta

I am working on someone's server that only has PHP version 5.0.4. I am not permitted to update the PHP version at this time because they have some old programs, etc. that would need to be c开发者_StackOverflow中文版hecked before the upgrade is made and they have not done so yet.

After numerous attempts to get my program which uses the stream_select() function to work, I just discovered that there is a bug in this function so that regardless of the status, it always returns the value of 0 to me.

You can see more details about the bug below:

https://bugs.php.net/bug.php?id=42682

So my question is this -- I am opening a socket and reading/writing to a stream. I need to know if the stream is available for reading. Are there any hacks I can use to get around this bug? I do not have that much experience with socket programming.

Thank you in advance.


Have you tried socket_select() ?

This will require you to use socket functions instead of stream ones, but socket_select may (or may not) be free from this bug.

0

精彩评论

暂无评论...
验证码 换一张
取 消