Re: [WebDNA] HTTP Streaming - POSSIBLE!

This WebDNA talk-list message is from

2010


It keeps the original formatting.
numero = 105557
interpreted = N
texte = I wrote a DNA program that displayed a scoreboard to screens placed throughout an arena for an indoor soccer league. Every time the scoreboard was updated by the referee (score, timeout, qtr, etc.) - so upon every post, a new file was written into a directory. The name of the file was [text]thenextvar=[math]0[listfiles ../thedir/]+1[/listfiles]+1[/ math].txt[/text] [writefile ../thedir/thenextvar]could put the time or dynamic info that the client side script might use[/writefile] So it kept creating a sequential file names 1.txt 2.txt 3.txt etc. Then I had the video networked computer displaying the scoreboard webdna page. Which included a script that reloaded itself upon the creation of the next sequential file. [text]thenextvar=[math]0[listfiles ../thedir/]+1[/listfiles]+1[/ math].txt[/text] [waitforfile file=../thedir/[thenextvar]][!]don't use a timeout...[/!] [redirect index.tpl?tt=[date][time]] [/waitforfile] This is a pretty rough example, just trying to convey the concept. I'm a freelance webdna programmer with more than a decade of experience. If you need more help or want me to write it for you, I'd be happy to help.... Sincerely, Scott Walters scott@ideassoftware.com On Jul 11, 2010, at 6:58 PM, Kenneth Grome wrote: > 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! > > --------------------------------------------------------- > This message is sent to you because you are subscribed to > the mailing list . > To unsubscribe, E-mail to: > archives: http://mail.webdna.us/list/talk@webdna.us > Bug Reporting: support@webdna.us > Associated Messages, from the most recent to the oldest:

    
  1. Re: [WebDNA] HTTP Streaming - POSSIBLE! (Kenneth Grome 2010)
  2. Re: [WebDNA] HTTP Streaming - POSSIBLE! (Scott Walters 2010)
  3. Re: [WebDNA] HTTP Streaming - POSSIBLE! (Kenneth Grome 2010)
  4. Re: [WebDNA] HTTP Streaming - POSSIBLE! (Kenneth Grome 2010)
  5. Re: [WebDNA] HTTP Streaming - POSSIBLE! (Scott Walters 2010)
  6. Re: [WebDNA] HTTP Streaming - POSSIBLE! (Christer Olsson 2010)
  7. Re: [WebDNA] HTTP Streaming - POSSIBLE! (Kenneth Grome 2010)
  8. RE: [WebDNA] HTTP Streaming - POSSIBLE! ("Olin Lagon" 2010)
  9. Re: [WebDNA] HTTP Streaming - POSSIBLE! (Scott Walters 2010)
I wrote a DNA program that displayed a scoreboard to screens placed throughout an arena for an indoor soccer league. Every time the scoreboard was updated by the referee (score, timeout, qtr, etc.) - so upon every post, a new file was written into a directory. The name of the file was [text]thenextvar=[math]0[listfiles ../thedir/]+1[/listfiles]+1[/ math].txt[/text] [writefile ../thedir/thenextvar]could put the time or dynamic info that the client side script might use[/writefile] So it kept creating a sequential file names 1.txt 2.txt 3.txt etc. Then I had the video networked computer displaying the scoreboard webdna page. Which included a script that reloaded itself upon the creation of the next sequential file. [text]thenextvar=[math]0[listfiles ../thedir/]+1[/listfiles]+1[/ math].txt[/text] [waitforfile file=../thedir/[thenextvar]][!]don't use a timeout...[/!] [redirect index.tpl?tt=[date][time]] [/waitforfile] This is a pretty rough example, just trying to convey the concept. I'm a freelance webdna programmer with more than a decade of experience. If you need more help or want me to write it for you, I'd be happy to help.... Sincerely, Scott Walters scott@ideassoftware.com On Jul 11, 2010, at 6:58 PM, Kenneth Grome wrote: > 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! > > --------------------------------------------------------- > This message is sent to you because you are subscribed to > the mailing list . > To unsubscribe, E-mail to: > archives: http://mail.webdna.us/list/talk@webdna.us > Bug Reporting: support@webdna.us > Scott Walters

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:

Multiple SSL Keys (1998) New public beta available (1997) Converting SQL Microtime to Date and Time (2003) WebTen and WebCat (1997) [OT] Weird Characters (2004) WebCatalog2 Feature Feedback (1996) Errata: WCS Newbie question (1997) OT Domain Management (2003) [input] [/input] (1997) text size limitation (1997) Dark Horse Comics success story (1997) WebCat2b13MacPlugIn - more [date] problems (1997) Emailer setup (1997) version history page for webcat on the SM site? (2000) Append File help needed: example (2000) A new bug? (1999) Orderfile context problem (1998) emailer settings and control questions (1997) Accepting credit cards (1997) problems with 2 tags (1997)