Reading HTTP server push streams with Python

Posted by Sam on Stack Overflow See other posts from Stack Overflow or by Sam
Published on 2010-04-26T20:53:14Z Indexed on 2010/04/26 21:13 UTC
Read the original article Hit count: 337

Filed under:
|
|

I'm playing around trying to write a client for a site which provides data as an HTTP stream (aka HTTP server push). However, urllib2.urlopen() grabs the stream in its current state and then closes the connection. I tried skipping urllib2 and using httplib directly, but this seems to have the same behaviour.

Is there a way to get the stream to stay open, so it can be checked each program loop for new contents, rather than waiting for the whole thing to be redownloaded every few seconds, introducing lag?

© Stack Overflow or respective owner

Related posts about python

Related posts about http