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:

writefile and texte (1997) [protect admin] (1997) orderfile and setlineitems (1998) WebCatalog2 for NT Beta Request (1997) Authorizenet - version 3.1 compliance (2002) Problems with [Applescript] (1997) No Wanna Duppys (1998) Date Time Oddness (1999) setting HTTP response header (1998) 'does not contain' operator needed ... (1997) OT JavaScript question (1999) NT IIS number of files limit (2003) Bulk Email >>>>Any ideas? (2001) Shownext problems (1999) sort problems....bug or brain fart? (1997) all records returned. (1997) Re:Up-date for Webcatalog 2.0 (1998) test (2002) paymethod=cc allows all zeros (1999) WebCat editing, SiteGuard & SiteEdit (1997)