<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd"
	xmlns:media="http://search.yahoo.com/mrss/"
>

<channel>
	<title>Software As She's Developed &#187; Two-Way Web</title>
	<atom:link href="http://softwareas.com/tag/two-way-web/feed" rel="self" type="application/rss+xml" />
	<link>http://softwareas.com</link>
	<description>Mahemoff's Podcast/Blog - Web, Programming, Usability from the Author of 'Ajax Design Patterns' (AjaxPatterns.org)</description>
	<lastBuildDate>Wed, 25 Aug 2010 11:40:31 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<!-- podcast_generator="podPress/8.8" - maintenance_release="8.8.4" -->
		<copyright>Copyright &amp;#xA9; Software As She's Developed 2010 </copyright>
		<managingEditor>michael@mahemoff.com (Software As She's Developed)</managingEditor>
		<webMaster>michael@mahemoff.com (Software As She's Developed)</webMaster>
		<category>posts</category>
		<ttl>1440</ttl>
		<itunes:keywords></itunes:keywords>
		<itunes:subtitle></itunes:subtitle>
		<itunes:summary>Mahemoff's Podcast/Blog - Web, Programming, Usability from the Author of 'Ajax Design Patterns' (AjaxPatterns.org)</itunes:summary>
		<itunes:author>Software As She's Developed</itunes:author>
		<itunes:category text="Society &amp; Culture"/>
		<itunes:owner>
			<itunes:name>Software As She's Developed</itunes:name>
			<itunes:email>michael@mahemoff.com</itunes:email>
		</itunes:owner>
		<itunes:block>No</itunes:block>
		<itunes:explicit>no</itunes:explicit>
		<itunes:image href="http://softwareas.com/wp-content/plugins/podpress/images/powered_by_podpress_large.jpg" />
		<image>
			<url>http://softwareas.com/wp-content/plugins/podpress/images/powered_by_podpress.jpg</url>
			<title>Software As She's Developed</title>
			<link>http://softwareas.com</link>
			<width>144</width>
			<height>144</height>
		</image>
		<item>
		<title>Two-Way Web: Can You Stream In Both Directions?</title>
		<link>http://softwareas.com/two-way-web-can-you-stream-in-both-directions</link>
		<comments>http://softwareas.com/two-way-web-can-you-stream-in-both-directions#comments</comments>
		<pubDate>Thu, 13 Jul 2006 22:42:09 +0000</pubDate>
		<dc:creator>mahemoff</dc:creator>
				<category><![CDATA[SoftwareDev]]></category>
		<category><![CDATA[CollaborativeWeb]]></category>
		<category><![CDATA[Comet]]></category>
		<category><![CDATA[Duplex]]></category>
		<category><![CDATA[HTTP]]></category>
		<category><![CDATA[Push]]></category>
		<category><![CDATA[Streaming]]></category>
		<category><![CDATA[Two-Way Web]]></category>

		<guid isPermaLink="false">http://www.softwareas.com/two-way-web-can-you-stream-in-both-directions</guid>
		<description><![CDATA[

Update (couple of hrs later): I mailed Alex Russell (the guy who named Comet and knows plenty about it), it sounds like he&#8217;s been investigating this whole area and he&#8217;s sent me his views.

We know about Comet (AKA Push, HTTP Streaming) and its ability to keep streaming info from server to browser. How about streaming [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://img528.imageshack.us/img528/1461/duplexcomet7mj.png"/></p>

<p><i><b>Update (couple of hrs later):</b> I mailed Alex Russell (the guy who named Comet and knows plenty about it), it sounds like he&#8217;s been investigating this whole area and he&#8217;s sent me his views.</i></p>

<p>We know about <a href="http://softwareas.com/Comet">Comet</a> (AKA Push, <a href="http://ajaxpatterns.org/HTTP_Streaming">HTTP Streaming</a>) and its ability to keep streaming info from server to browser. <b>How about streaming upwards, from browser to server, and preferably in the same connection?</b> A reader mailed me this query:</p>

<blockquote>
<p>Im missing one demo, would it be possible to reuse same stream in
streaming demos to send msg to server, I&#8217;ve been digging throw your
examples, but they all seem to
create a new connection to the server when posting, would be very
interesting see a demo that does this within the same stream, and of
course the server code would be as interesting as the client.
</p></blockquote>

<p>Here&#8217;s my thinking, I&#8217;m sure a lot of smart readers will know more about this and I&#8217;ll be interested in your views &#8211; is it feasible? Any online demos?</p>

<blockquote>
<p>Unfortunately, I&#8217;ve not seen anyone pull this off &#8211; it&#8217;s always assumed you need a &#8220;back channel&#8221;. It&#8217;s the kind of hack someone like Google or 37S would turn around and pull off even though it&#8217;s &#8220;obviously impossible&#8221;  <img src='http://softwareas.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' />  .

</p><p>There are two key issues:
</p><p>(1) Server needs to start outputting before incoming request is finished. With a specialised server, this problem could be overcome.
</p><p>(2) (More serious as we can&#8217;t control the browser) The browser would need to upload data in a continuous stream. You can do it with Flash/Java, but I can&#8217;t see how to do this with standard JS/HTML. If you use XHR, you&#8217;re going to call send() and wave goodbye to the entire request&#8230;there&#8217;s no support for sequencing it. Same if you submit a regular form, change IFrame&#8217;s source etc. Even if you could somehow delay reading of content so it&#8217;s not immediately uploaded, the browser would probably end up not sending anything at all as it would be waiting to fill up a packet.

</p><p>I think the solution lies in the <a href="http://httpd.apache.org/docs/1.3/keepalive.html">Keep-Alive</a> extension to HTTP 1.1:
<blockquote>
<p>What is Keep-Alive?
</p><p>The Keep-Alive extension to HTTP, as defined by the HTTP/1.1 draft, allows persistent connections. These long-lived HTTP sessions allow multiple requests to be send over the same TCP connection, and in some cases have been shown to result in an almost 50% speedup in latency times for HTML documents with lots of images.
</p></blockquote>

</p><p>If you google for &#8220;xmlhttprequest keep-alive&#8221; or &#8220;ajax keep-alive&#8221;, you&#8217;ll see people talking about the idea a bit, but there&#8217;s not much info on how to script it for continuous connections and no demos to be found. It would make a great experiment if someone did a proof-of-concept!

</p><p>As an alternative, you could consider a thin, invisible, Flash layer to handle transport, and degrade to frequent <a href="http://ajaxpatterns.org/Submission_Throttling">Submission Throttling</a> where Flash isn&#8217;t an option.
</p></blockquote>

<p>&lt;</p>

<p>p>BTW I have a post and podcast planned about the whole two-way web thing, which will be profound (the two-way web thing, not the podcast <img src='http://softwareas.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> ). The web is entering a new era of Real-Time Collaboration and Communication, post-Ajax (and of course building on Ajax, just as Ajax builds on the technologies of the previous era: CGI, DHTML, CSS, etc).</p>

<p>Update: As mentioned above, Alex Russell mailed me his views. In particular, it&#8217;s interesting to consider the possibility that browsers might transparently exploit keep-alive if you hit the server frequently enough.</p>

<blockquote>
<p>So I&#8217;ve spent some time investigating this (as you might expect), and at 
the end of the day there&#8217;s not much to be done aside from using Flash 
and their XMLSocket interface. That&#8217;s an obvious possibility given the 
high-performance Flash communication infrastructure we have in Dojo. 
Doing bi-directional HTTP probably won&#8217;t happen, though, but I don&#8217;t 
think that&#8217;s cause for despair. In my tests, we can get really good 
(relative) performance out of distinct HTTP requests so long as the 
content of the request is kept to a minimum and the server can process 
the connection fast enough. HTTP keepalive exists at a level somewhat 
below what&#8217;s currently exposed to browsers, so if the client and server 
support it, frequent requests through stock XHR objects may verywell be 
using it anyway. We&#8217;ll have to do some significant testing to determine 
what conjunctions of servers/clients might do this, however.

</p><p>There are even more exotic approaches available from Flash peering that 
I&#8217;ve been investigating as well, but they will require significantly 
different infrastructure from what we already deploy that I think 
they&#8217;re still in the land of &#8220;hrm&#8230;someday&#8221;. 

</p><p>First we have to solve the *regular* Comet scalability problems for 
existing servers and app containers.

</p><p>Regards

</p><p>PS: we haven&#8217;t been making much noise about it, but serious work has 
started on an Open Source Comet protocol with initial implmemntations 
in both Perl and Python over at http://cometd.org. The initial client 
library is Dojo-based, but we&#8217;ll be publishing the protocol so that 
anyone can &#8220;play&#8221; with it.
</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://softwareas.com/two-way-web-can-you-stream-in-both-directions/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>
