Re: PHP fread() hanging when using HTTP-REST api

2009-01-02 Thread staticfloat

Thanks guys, I'll check out cURL for future reference, but I've solved
the problem.  Looks like it's a simple overloaded server problem.  The
webserver I'm working on is a shared server, so when another client
gets a spike, or the network is busy, one of my requests might drop,
causing file_get_contents() or an fopen()/fread() to wait for 60
seconds before timing out.  Solution; change the socket timeout time
length, and use something incremental (like fread()) so that I can be
flexible in my error handling.
Again, thanks for the replies.
-E

On Jan 2, 10:18 am, "Ed Finkler"  wrote:
> Unlikely to be a problem on Twitter's end. On your server, can you
> make the connection with the command line using cURL? If so, it's
> almost certainly something specific to how fread() is doing the call.
>
> FWIW, I use file_get_contents() (which is identical to what you're
> likely doing, but in one call) successfully on these sites:
>
> http://funkatron.com/twitter-trend-statshttp://funkatron.com/twitter-source-stats
>
> --
> Ed Finklerhttp://funkatron.com
> AIM: funka7ron
> ICQ: 3922133
> Skype: funka7ron
>
> On Fri, Jan 2, 2009 at 12:29 PM, staticfloat  wrote:
>
> > Hey, I'm just trying to fopen()/fread() the status updates of a user
> > on twitter (http://twitter.com/statuses/user_timeline/
> > staticfloat.rss), and my fread()'s randomly hang and timeout after 60
> > seconds.  It's totally possible this is a problem on my servers' end,
> > but is there any reason this might be a problem with the twitter
> > severs?  I've whitelisted the user I'm trying to connect to, and on my
> > home computer, the script works flawlessly.


PHP fread() hanging when using HTTP-REST api

2009-01-02 Thread staticfloat

Hey, I'm just trying to fopen()/fread() the status updates of a user
on twitter (http://twitter.com/statuses/user_timeline/
staticfloat.rss), and my fread()'s randomly hang and timeout after 60
seconds.  It's totally possible this is a problem on my servers' end,
but is there any reason this might be a problem with the twitter
severs?  I've whitelisted the user I'm trying to connect to, and on my
home computer, the script works flawlessly.