[WebDNA] HTTP Streaming -- impossible?

This WebDNA talk-list message is from

2010


It keeps the original formatting.
numero = 105538
interpreted = N
texte = Has anyone actually done HTTP streaming in webdna? My understanding of the basic concept is that the server receives a request from the browser, then it keeps the connection open via a long running (or infinite) loop of some kind, and then it periodically pushes new data to the outgoing stream and flushes the stream -- without closing the connection. I can create a loop in webdna with no problem, but how do I flush the periodic data to the stream without the server closing the connection? I have tried this as a test: [loop start=1&end=10] [waitforfile file=doesNotExist.txt&timeout=2][/waitforfile] [writefile textFile.txt][time][/writefile] [include textFile.txt]
[/loop] ... but of course this does not work because the page is not rendered until after the loop stops running. I get these results all at once, but what I actually want is one line at a time pushed to the stream/browser every 2 seconds: 17:39:36 17:39:37 17:39:39 17:39:40 17:39:41 17:39:42 17:39:43 17:39:45 17:39:46 17:39:47 I know a lot about webdna, but at the moment I cannot think of a way to make this work. Can any of you? The problem is that webdna does not produce any results or render the page until ALL the code on the page has been interpreted. Only then will it send the results to the server -- which then forwards those results on to the browser and closes the connection. Anyone see any webdna-based alternatives here? Sincerely, Kenneth Grome P.S. As an aside, my test seems to indicate that the timer in "waitforfile" is not very accurate. The total time for all 10 lines to be processed should have been 20 seconds, not 11. Let that be a lesson to anyone who wants to rely on the accuracy of the waitforfile timer! Associated Messages, from the most recent to the oldest:

    
  1. Re: [WebDNA] HTTP Streaming -- impossible? (Kenneth Grome 2010)
  2. Re: [WebDNA] HTTP Streaming -- impossible? (christophe.billiottet@webdna.us 2010)
  3. Re: [WebDNA] HTTP Streaming -- impossible? (Kenneth Grome 2010)
  4. Re: [WebDNA] HTTP Streaming -- impossible? (Kenneth Grome 2010)
  5. Re: [WebDNA] HTTP Streaming -- impossible? (Kenneth Grome 2010)
  6. Re: [WebDNA] HTTP Streaming -- impossible? (Govinda 2010)
  7. Re: [WebDNA] HTTP Streaming -- impossible? (sal danna 2010)
  8. Re: [WebDNA] HTTP Streaming -- impossible? (Jesse Proudman 2010)
  9. Re: [WebDNA] HTTP Streaming -- impossible? (Kenneth Grome 2010)
  10. Re: [WebDNA] HTTP Streaming -- impossible? (Jesse Proudman 2010)
  11. Re: [WebDNA] HTTP Streaming -- impossible? (Kenneth Grome 2010)
  12. Re: [WebDNA] HTTP Streaming -- impossible? (Govinda 2010)
  13. Re: [WebDNA] HTTP Streaming -- impossible? (Kenneth Grome 2010)
  14. Re: [WebDNA] HTTP Streaming -- impossible? (Brian Fries 2010)
  15. Re: [WebDNA] HTTP Streaming -- impossible? (Kenneth Grome 2010)
  16. Re: [WebDNA] HTTP Streaming -- impossible? (Kenneth Grome 2010)
  17. Re: [WebDNA] HTTP Streaming -- impossible? (Marc Thompson 2010)
  18. Re: [WebDNA] HTTP Streaming -- impossible? (sal danna 2010)
  19. Re: [WebDNA] HTTP Streaming -- impossible? (Lawrence 2010)
  20. Re: [WebDNA] HTTP Streaming -- impossible? (Kenneth Grome 2010)
  21. Re: [WebDNA] HTTP Streaming -- impossible? (Stuart Tremain 2010)
  22. Re: [WebDNA] HTTP Streaming -- impossible? (Kenneth Grome 2010)
  23. Re: [WebDNA] HTTP Streaming -- impossible? (Kenneth Grome 2010)
  24. Re: [WebDNA] HTTP Streaming -- impossible? (Stuart Tremain 2010)
  25. Re: [WebDNA] HTTP Streaming -- impossible? (sal danna 2010)
  26. [WebDNA] HTTP Streaming -- impossible? (Kenneth Grome 2010)
Has anyone actually done HTTP streaming in webdna? My understanding of the basic concept is that the server receives a request from the browser, then it keeps the connection open via a long running (or infinite) loop of some kind, and then it periodically pushes new data to the outgoing stream and flushes the stream -- without closing the connection. I can create a loop in webdna with no problem, but how do I flush the periodic data to the stream without the server closing the connection? I have tried this as a test: [loop start=1&end=10] [waitforfile file=doesNotExist.txt&timeout=2][/waitforfile] [writefile textFile.txt][time][/writefile] [include textFile.txt]
[/loop] ... but of course this does not work because the page is not rendered until after the loop stops running. I get these results all at once, but what I actually want is one line at a time pushed to the stream/browser every 2 seconds: 17:39:36 17:39:37 17:39:39 17:39:40 17:39:41 17:39:42 17:39:43 17:39:45 17:39:46 17:39:47 I know a lot about webdna, but at the moment I cannot think of a way to make this work. Can any of you? The problem is that webdna does not produce any results or render the page until ALL the code on the page has been interpreted. Only then will it send the results to the server -- which then forwards those results on to the browser and closes the connection. Anyone see any webdna-based alternatives here? Sincerely, Kenneth Grome P.S. As an aside, my test seems to indicate that the timer in "waitforfile" is not very accurate. The total time for all 10 lines to be processed should have been 20 seconds, not 11. Let that be a lesson to anyone who wants to rely on the accuracy of the waitforfile timer! Kenneth Grome

DOWNLOAD WEBDNA NOW!

Top Articles:

Talk List

The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...

Related Readings:

E-mailer error codes (1997) Webstar 1.3.1 PPC (1997) Searching multiple fields (1997) URGENT can not.... (2006) MATH (1998) AOL and [referrer] (2001) [WebDNA] Carriage Return/Line Feed Issue (2009) removing programming logic white space (2003) F3 crashing server (1997) FWD: Autoproxy Bug with WebCatalog and FireSite (1997) Error Log.db --however (1997) [OT] Who's got a cool link (2002) Spaces inside [AppendFile] (1998) db security on NT (1997) Forbidden CGI Error (1997) TaxTotal Problem (1997) Separate SSL Server (1997) process out of control....... (2002) NT Woes (1997) Re:quit command on NT (1997)