<?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/"
	>

<channel>
	<title>*drawlogic &#187; real-time</title>
	<atom:link href="http://drawlogic.com/tag/real-time/feed/" rel="self" type="application/rss+xml" />
	<link>http://drawlogic.com</link>
	<description>interactive and game development technologies for the web - flash, flex, unity3d, silverlight, javascript</description>
	<lastBuildDate>Thu, 17 May 2012 13:12:20 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Web Sockets in Google Chrome and Proposed Standard for HTML5</title>
		<link>http://drawlogic.com/2009/12/09/web-sockets-in-google-chrome-and-proposed-standard-for-html5/</link>
		<comments>http://drawlogic.com/2009/12/09/web-sockets-in-google-chrome-and-proposed-standard-for-html5/#comments</comments>
		<pubDate>Thu, 10 Dec 2009 04:24:37 +0000</pubDate>
		<dc:creator>drawk</dc:creator>
				<category><![CDATA[AJAX]]></category>
		<category><![CDATA[APPLICATIONS]]></category>
		<category><![CDATA[network]]></category>
		<category><![CDATA[PROGRAMMING]]></category>
		<category><![CDATA[TECHNOLOGY]]></category>
		<category><![CDATA[chrome]]></category>
		<category><![CDATA[gaming]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[INTERACTIVE]]></category>
		<category><![CDATA[real-time]]></category>
		<category><![CDATA[sockets]]></category>
		<category><![CDATA[standard]]></category>
		<category><![CDATA[tcp]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://drawlogic.com/?p=705</guid>
		<description><![CDATA[Google is pushing Web Sockets into Chrome based on the Web Socket standards being developed at all major engineering standards groups.  Web Socket is an interesting direction but it is great to couple that with O3G or WebGL for some multiplayer 3d game development with just a browser. Starting in the Google Chrome developer channel release [...]]]></description>
			<content:encoded><![CDATA[<p><strong><img class="alignright" title="Web Sockets in Chrome Google" src="http://i81.photobucket.com/albums/j223/drawkbox/google-logo.png" alt="" width="233" height="222" /><a href="http://blog.chromium.org/2009/12/web-sockets-now-available-in-google.html" target="_blank">Google is pushing Web Sockets</a></strong> into Chrome based on the Web Socket standards being developed at all major engineering standards groups.  <a href="http://blog.chromium.org/2009/12/web-sockets-now-available-in-google.html" target="_blank">Web Socket</a> is an interesting direction but it is great to couple that with <a href="http://drawlogic.com/2009/04/21/google-releases-o3d-plugin-for-3d-in-browser-controlled-with-javascript/" target="_blank">O3G</a> or <a href="http://drawlogic.com/2009/08/08/webgl-announced-javascript-controlled-opengl-standard-is-now-official-at-khronos-group-who-runs-opengl-openvg-opengl-es/" target="_blank">WebGL</a> for some multiplayer 3d game development with just a browser.</p>
<blockquote><p>Starting in the Google Chrome <a href="http://www.chromium.org/getting-involved/dev-channel">developer channel</a> release 4.0.249.0, Web Sockets are available and enabled by default. Web Sockets are &#8220;TCP for the Web,&#8221; a next-generation bidirectional communication technology for web applications being standardized in part of <a href="http://www.whatwg.org/specs/web-apps/current-work/complete.html">Web Applications 1.0</a>. We&#8217;ve implemented this feature as described in our design docs for <a href="http://docs.google.com/View?docID=dfm7gfvg_0fpjg22gh&amp;revision=_latest">WebKit</a> and <a href="http://docs.google.com/View?docID=dfm7gfvg_1dm97qxgm&amp;revision=_latest">Chromium</a>.</p></blockquote>
<p><strong>Sample Code</strong></p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;WebSocket&quot;</span> <span style="color: #000066; font-weight: bold;">in</span> window<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #003366; font-weight: bold;">var</span> ws <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> WebSocket<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;ws://example.com/service&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  ws.<span style="color: #660066;">onopen</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #006600; font-style: italic;">// Web Socket is connected. You can send data by send() method.</span>
    ws.<span style="color: #660066;">send</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;message to send&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> ....
  <span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
  ws.<span style="color: #660066;">onmessage</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span>evt<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #003366; font-weight: bold;">var</span> received_msg <span style="color: #339933;">=</span> evt.<span style="color: #660066;">data</span><span style="color: #339933;">;</span> ... <span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
  ws.<span style="color: #660066;">onclose</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #006600; font-style: italic;">// websocket is closed. };</span>
<span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #006600; font-style: italic;">// the browser doesn't support WebSocket.</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p><strong>Socket Advantage</strong></p>
<p>Flash has long been the answer for sockets for web applications and once sockets were added to Flash it instantly became a better interactive and gaming platform for multi-user applications and multiplayer games. They started with <a href="http://livedocs.adobe.com/flex/3/langref/flash/net/XMLSocket.html" target="_blank">XmlSocket </a>then recently added <a href="http://livedocs.adobe.com/flex/3/langref/flash/net/Socket.html" target="_blank">Socket</a> for raw binary data in as3.  <a href="http://msdn.microsoft.com/en-us/library/cc296248(VS.95).aspx" target="_blank">Silverlight </a>and Java also have this feature but having this in script is pretty significant because many applications could really use a browser supported bi-directional communication link.</p>
<p><strong>What is Missing</strong></p>
<p><strong>The biggie missing from Flash, Silverlight, etc and Web Sockets is UDP and preferably RUDP or Reliable UDP which allows UDP datagrams to be sent back and forth either verified delivery or broadcast.</strong> Unity does support UDP.  The best socket layers are reliable UDP based because mixing TCP and UDP can lead to queuing and not all messages are critical so having just UDP isn&#8217;t enough, having TCP is too much.  Reliable UDP is the way to go but so far no web layers are doing it well except Unity on that one (you still have to make your own RUDP implementation &#8211; libraries like <a href="http://www.jenkinssoftware.com/" target="_blank">Raknet </a>or <a href="http://enet.bespin.org/" target="_blank">enet</a> in C/C++ give you this but you can&#8217;t use that in Unity client only on the server). (Edit: Flash does have <a href="http://drawlogic.com/2008/12/12/adobe-stratus-client-to-client-flash-communication-p2p-with-rtmfp/" target="_blank">RTMFP</a> which is based on UDP and uses FMS for nat for p2p but it is still not a true low level UDP socket just yet as it supports more features. A low-level UDP socket would also be nice in flash.)</p>
<p><strong>Web Communication Evolving</strong></p>
<p>I am a big Flash fan and have been developing it since 1999 among other platforms, I have recently watched other technologies nearly match the features and some go beyond it.  The interesting thing about Web Sockets is that it does go after a core feature of flash; Canvas and WebGL or O3D also do.<strong> Flash still has the webcam, mic, sound mixers/tranform, and for now sockets which put it at an advantage in gaming and interactive. </strong> Flash used to  be the sole greatest video player but Silverlight is doing a pretty good job of that as well so that is still an advantage but others are entering including possibly browser support in html5. I still think it is the best video but they would need to keep innovating.</p>
<p><strong>Another interesting point about this is XMLHttpRequest objects.  Originally <a href="http://garrettsmith.net/blog/archives/2006/01/microsoft_inven_1.html" target="_blank">&#8220;AJAX&#8221; was created by Microsoft for IE</a>, pushing new features and innovating back when IE was a good browser and ahead in IE4. </strong> Mozilla and others adopted this feature (as well as editable text areas for html) because they were great features for web applications to evolve to.  now Google is pushing with Chrome and Web Sockets is the next step that should be in web browsers even if it is only TCP based for now.  This will add great capabilities and will probably be preferred over AJAX/XMLHttpRequest for really interactive and real-time tools/games should it take hold.  Ian Hickson is running the table on the standards with this effort and it is a good one to get behind.</p>
<ul>
<li><a href="http://blog.chromium.org/2009/12/web-sockets-now-available-in-google.html" target="_blank"><strong>Blog post about Web Sockets</strong></a></li>
<li><a href="http://dev.w3.org/html5/websockets/" target="_blank"><strong>W3C Standard</strong></a> proposed by Google (Ian Hickson)</li>
<li><a href="http://www.whatwg.org/specs/web-apps/current-work/complete.html" target="_blank"><strong>WHATWG Standard</strong></a><strong> </strong>proposed by Google (Ian Hickson)</li>
<li><a href="http://tools.ietf.org/html/draft-hixie-thewebsocketprotocol-55" target="_blank"><strong>IETF RFC</strong></a> &#8216;web socket protocol&#8217; by hixie (Ian Hickson)</li>
<li><a href="http://code.google.com/p/pywebsocket/" target="_blank"><strong>pywebsocket </strong></a>for Apache to test with Web Sockets</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://drawlogic.com/2009/12/09/web-sockets-in-google-chrome-and-proposed-standard-for-html5/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Adobe Stratus, Client to Client Flash Communication (P2P) with RTMFP</title>
		<link>http://drawlogic.com/2008/12/12/adobe-stratus-client-to-client-flash-communication-p2p-with-rtmfp/</link>
		<comments>http://drawlogic.com/2008/12/12/adobe-stratus-client-to-client-flash-communication-p2p-with-rtmfp/#comments</comments>
		<pubDate>Fri, 12 Dec 2008 10:58:56 +0000</pubDate>
		<dc:creator>drawk</dc:creator>
				<category><![CDATA[ACTIONSCRIPT]]></category>
		<category><![CDATA[ACTIONSCRIPT3]]></category>
		<category><![CDATA[ADOBE]]></category>
		<category><![CDATA[APPLICATIONS]]></category>
		<category><![CDATA[ARCHITECT]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[DEVELOPMENT]]></category>
		<category><![CDATA[FLASH]]></category>
		<category><![CDATA[FLEX]]></category>
		<category><![CDATA[GAMEDEV]]></category>
		<category><![CDATA[network]]></category>
		<category><![CDATA[PROGRAMMING]]></category>
		<category><![CDATA[STANDARDS]]></category>
		<category><![CDATA[TECHNOLOGY]]></category>
		<category><![CDATA[MULTI-USER]]></category>
		<category><![CDATA[networking]]></category>
		<category><![CDATA[p2p]]></category>
		<category><![CDATA[real-time]]></category>
		<category><![CDATA[RTMFP]]></category>
		<category><![CDATA[service]]></category>
		<category><![CDATA[virtual]]></category>

		<guid isPermaLink="false">http://drawlogic.com/?p=306</guid>
		<description><![CDATA[Adobe stratus sounds pretty interesting for flash client to client communication much like peer to peer networks for small numbers of people. Want to build a video chat application, multi-player games or voice-over-ip applications for the Flash Player or AIR without worrying about setting up a server infrastructure? Stratus (which we showcased at MAX) is [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignright" title="Stratus" src="http://farm4.static.flickr.com/3121/3102472294_042ff55e03_o.jpg" alt="" width="215" height="215" /><a href="http://labs.adobe.com/technologies/stratus/" target="_blank">Adobe stratus</a> sounds pretty interesting for <a href="http://www.webkitchen.be/2008/12/12/start-playing-with-adobe-stratus-client-to-client-communication/" target="_blank">flash client to client communication</a> much like peer to peer networks for small numbers of people.</p>
<blockquote><p>Want to build a video chat application, multi-player games or voice-over-ip applications for the Flash Player or AIR without worrying about setting up a server infrastructure? Stratus (which we showcased at MAX) is your new best friend.</p></blockquote>
<blockquote><p>Stratus is a beta hosted rendezvous service that <strong>helps establish communication between Flash Player or AIR clients. Once two clients are connected to Stratus</strong>, <strong>they can send data directly client to client.</strong> The APIs in Flash Player 10 and Adobe AIR 1.5 allow for <strong>point-to-point communication between a small number of subscribers</strong>. Publishers have to send data to all subscribing clients, so the number of subscribers is limited to the available bandwidth on the publisher end.</p></blockquote>
<p>This must be one of the first Real-Time Media Flow Protocol (RTMFP) protocol usage programs from Adobe?  Basically this protocol is adding better UDP or broadcast support which allows for larger sets of users and is common in large scale real-time games.  Here it seems to be more of a peer to peer usage rather than authoratative approach (maybe flash media server will have large user set support with this) which limits to about 15 users or the lowest latency in the group with anything close to real-time syncing. Stratus seems like more of a matchmaking middle man to help with nat punchthrough and then it relies on peer to peer.  But more fun in store checking it out.</p>
<p>P2P like this can&#8217;t really be used for games due to cheating unless one client is the independent server but this works great for small file sharing apps, whiteboards, chats, watching videos at the same time, etc.</p>
]]></content:encoded>
			<wfw:commentRss>http://drawlogic.com/2008/12/12/adobe-stratus-client-to-client-flash-communication-p2p-with-rtmfp/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>

