ApnsPHP icon indicating copy to clipboard operation
ApnsPHP copied to clipboard

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

Open JohnyDays opened this issue 9 years ago • 7 comments

JohnyDays avatar Apr 13 '15 12:04 JohnyDays

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

hepspl avatar May 10 '15 07:05 hepspl

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

JohnyDays avatar May 11 '15 08:05 JohnyDays

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.

rwforsythe avatar May 20 '15 01:05 rwforsythe

THANK YOU!

niclashedam avatar Jul 16 '15 22:07 niclashedam

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

rwforsythe avatar Jul 16 '15 23:07 rwforsythe

@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

niclashedam avatar Jul 17 '15 00:07 niclashedam

@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

Zaeembinrehman avatar Apr 07 '16 15:04 Zaeembinrehman