Am 26.01.2014 22:46, schrieb Carsten A. Arnholm: > On 26. jan. 2014 14:48, Tommi Mäkitalo wrote: >> I already implemented yesterday and today chunked encoding with tntnet. >> It works quite fine. I have to fix a crash on cleanup but when it is >> done, I will commit it. I think, it is a nice feature. >> >> Tommi > Interesting! > > Does this mean the application can simply feed images "as fast as > possible" without stopping? I guess in the HTML-code there must be > something else than an <img> tag.... > > Perhaps something like > <EMBED SRC="myvideo.mp4" > WIDTH="1024" HEIGHT="768" > AUTOPLAY="true"> > </EMBED> > > and then replace the myvideo.mp4 with a comonent reference that actually > feeds the data? Perhaps mp4 is not the optimal format, but anyway... > something that is as browser friendly as possible. > > Best regard > Carsten > Hi Carsten,
it has nothing to do with the tags. It is just a question, how the reply is sent to the browser. In case of a dynamically created document chunked encoding gives us a chance to start sending the data earlier. Without chunked encoding the full document has to be ready before the first bytes go over the wire. With chunked encoding tntnet starts sending the reply as soon as the first chunk is created or the stream is flushed. I set the chunk size to 8192 bytes so that if you enable chunked encoding sending starts after the first 8192 bytes are put to the output stream. There is one limitation though. Tntnet checks at the end of the request if the component has created a new session. If so, it sends a session cookie to the browser. When chunked encoding is used, the headers are already sent and tntnet has no chance to send the cookie. So a new session cannot be created when chunked encoding is used. I implemented chunked encoding already but it does not work fully. I have to fix it before I can commit the change. The API is really easy. Calling "reply.setChunkedEncoding()" enables it. Nothing else need to be done. Tommi ------------------------------------------------------------------------------ CenturyLink Cloud: The Leader in Enterprise Cloud Services. Learn Why More Businesses Are Choosing CenturyLink Cloud For Critical Workloads, Development Environments & Everything In Between. Get a Quote or Start a Free Trial Today. http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk _______________________________________________ Tntnet-general mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/tntnet-general
