immobiliare / ApnsPHP

ApnsPHP: Apple Push Notification & Feedback Provider
BSD 3-Clause "New" or "Revised" License
1.44k stars 452 forks source link

fread would hang indefinitely when socket was empty, this prevents that. #86

Open JohnyDays opened 9 years ago

hepspl commented 9 years ago

Thank you, man! It fixed my broken cron which had been broken for weeks because of that issue.

JohnyDays commented 9 years ago

Exact same thing happened to me, glad to help! After reading through the issues, it seems like it's a php bug (or behaviour change) introduced in some of the latest versions, where fread waits for the specified number of bytes to arrive in the socket and they never do, whereas before it wouldnt, and this is only a temporary fix and may even cause some side effects. Regardless, it fixed it in my use case and everything seems to be working

rwforsythe commented 9 years ago

This seems to temporarily solve the problem, but any errors that would normally be bounced immediately are not reported. Instead they report as successfully sent.

niclashedam commented 9 years ago

THANK YOU!

rwforsythe commented 9 years ago

Note that this issue should have been fixed with newer versions of PHP: see https://github.com/immobiliare/ApnsPHP/issues/84

niclashedam commented 9 years ago

@rwforsythe Yea, I know. But my application runs on GAE, which means I have no control over the PHP version. It could take months before Google upgrades from PHP 5.5.23

Zaeembinrehman commented 8 years ago

@JohnyDays I have got the same issue but adding the 4 lines of this commit didn't solve issue for me.

PHP Version is as follows:

php git