Note that there are some explanatory texts on larger screens.

plurals
  1. POGoogle Apps HTTP Streaming with Python question
    primarykey
    data
    text
    <p>I got a little question here:</p> <p>Some time ago I implemented HTTP Streaming using PHP code, something similar to what is on this page:</p> <p><a href="http://my.opera.com/WebApplications/blog/show.dml/438711#comments" rel="nofollow noreferrer">http://my.opera.com/WebApplications/blog/show.dml/438711#comments</a></p> <p>And I get data with very similar solution. Now I tried to use second code from this page (in Python), but no matter what I do, I receive responseText from python server after everything completes. Here are some python code:</p> <pre><code>print "Content-Type: application/x-www-form-urlencoded\n\n" i=1 while i&lt;4: print("Event: server-time&lt;br&gt;") print("data: %f&lt;br&gt;" % (time.time(),)) sys.stdout.flush() i=i+1 time.sleep(1) </code></pre> <p>And here is Javascript Code:</p> <pre><code>ask = new XMLHttpRequest(); ask.open("GET","/Chat",true); setInterval(function() { if (ask.responseText) document.write(ask.responseText); },200); ask.send(null); </code></pre> <p>Anyone got idea what I do wrong ? How can I receive those damn messages one after another, not just all of them at the end of while loop? Thanks for any help here!</p> <p>Edit:</p> <p>Main thing I forgot to add: server is google app server (i'm not sure is that google own implementation), here is a link with some explanation (i think uhh):</p> <p><a href="http://code.google.com/intl/pl-PL/appengine/docs/python/gettingstarted/devenvironment.html" rel="nofollow noreferrer"><a href="http://code.google.com/intl/pl-PL/appengine/docs/python/gettingstarted/devenvironment.html" rel="nofollow noreferrer">http://code.google.com/intl/pl-PL/appengine/docs/python/gettingstarted/devenvironment.html</a></a> <a href="http://code.google.com/intl/pl-PL/appengine/docs/whatisgoogleappengine.html" rel="nofollow noreferrer"><a href="http://code.google.com/intl/pl-PL/appengine/docs/whatisgoogleappengine.html" rel="nofollow noreferrer">http://code.google.com/intl/pl-PL/appengine/docs/whatisgoogleappengine.html</a></a></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload