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

<channel>
	<title>FlashRealtime.com</title>
	<atom:link href="http://www.flashrealtime.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.flashrealtime.com</link>
	<description>Realtime Rich Internet Applications using Adobe technologies</description>
	<pubDate>Thu, 02 Sep 2010 07:57:40 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>UDP in Adobe AIR 2.0</title>
		<link>http://www.flashrealtime.com/udp-in-adobe-air-20/</link>
		<comments>http://www.flashrealtime.com/udp-in-adobe-air-20/#comments</comments>
		<pubDate>Wed, 01 Sep 2010 17:02:02 +0000</pubDate>
		<dc:creator>tom</dc:creator>
		
		<category><![CDATA[Video tutorial]]></category>

		<category><![CDATA[air]]></category>

		<category><![CDATA[air 2.0]]></category>

		<category><![CDATA[flash]]></category>

		<category><![CDATA[server]]></category>

		<category><![CDATA[udp]]></category>

		<category><![CDATA[universal datagram protocol]]></category>

		<guid isPermaLink="false">http://www.flashrealtime.com/?p=1845</guid>
		<description><![CDATA[
			
				
			
		
My fellow evangelist Michael Chaize put together a video on a related topic - UDP. See this presentation on how to start with UDP (Universal Datagram Protocol) in Adobe AIR 2.0.
Discover the UDP API in Adobe AIR 2.0

Check also his second tutorial - UDP Video in AIR 2.0.
Enjoy!
]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.flashrealtime.com%2Fudp-in-adobe-air-20%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.flashrealtime.com%2Fudp-in-adobe-air-20%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>My fellow evangelist <a href="http://www.riagora.com/">Michael Chaize</a> put together a video on a related topic - UDP. See this presentation on how to start with UDP (Universal Datagram Protocol) in Adobe AIR 2.0.</p>
<p><b>Discover the UDP API in Adobe AIR 2.0</b><br />
<object width="480" height="289"><param name="movie" value="http://images.tv.adobe.com/swf/player.swf"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><param name="FlashVars" value="fileID=7558&#038;context=64&#038;embeded=true&#038;environment=production"></param><embed src="http://images.tv.adobe.com/swf/player.swf" flashvars="fileID=7558&#038;context=64&#038;embeded=true&#038;environment=production" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="289"></embed></object></p>
<p>Check also his second tutorial - <a href="http://vimeo.com/12469067">UDP Video in AIR 2.0</a>.</p>
<p>Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.flashrealtime.com/udp-in-adobe-air-20/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Seminar Recording: Advanced P2P - Object Replication</title>
		<link>http://www.flashrealtime.com/seminar-recording-advanced-p2p-object-replication/</link>
		<comments>http://www.flashrealtime.com/seminar-recording-advanced-p2p-object-replication/#comments</comments>
		<pubDate>Mon, 30 Aug 2010 09:19:55 +0000</pubDate>
		<dc:creator>tom</dc:creator>
		
		<category><![CDATA[Video tutorial]]></category>

		<category><![CDATA[directed routing]]></category>

		<category><![CDATA[fms]]></category>

		<category><![CDATA[multicast]]></category>

		<category><![CDATA[object replication]]></category>

		<category><![CDATA[P2P]]></category>

		<category><![CDATA[peer-to-peer]]></category>

		<category><![CDATA[seminar]]></category>

		<category><![CDATA[stratus]]></category>

		<guid isPermaLink="false">http://www.flashrealtime.com/?p=1818</guid>
		<description><![CDATA[
			
				
			
		
The recording of seminar I did on Friday 27th 2010.
It includes information mostly about Object Replication and how to start with it. I also explain my P2P VoD project.
Check it out here (42 min.)
http://my.adobe.acrobat.com/p41024225/

]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.flashrealtime.com%2Fseminar-recording-advanced-p2p-object-replication%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.flashrealtime.com%2Fseminar-recording-advanced-p2p-object-replication%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>The recording of seminar I did on Friday 27th 2010.</p>
<p>It includes information mostly about Object Replication and how to start with it. I also explain my P2P VoD project.</p>
<p>Check it out here (42 min.)<br />
<a href="http://my.adobe.acrobat.com/p41024225/">http://my.adobe.acrobat.com/p41024225/</a><br />
<a href="http://my.adobe.acrobat.com/p41024225/"><img src="http://www.flashrealtime.com/wp-content/uploads/2010/08/advanced-p2p-connect.jpg" alt="advanced-p2p-connect" title="advanced-p2p-connect" width="480" height="323" class="alignleft size-full wp-image-1819" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.flashrealtime.com/seminar-recording-advanced-p2p-object-replication/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Local Flash Peer-to-Peer Communication over LAN (without Stratus)</title>
		<link>http://www.flashrealtime.com/local-flash-peer-to-peer-communication-over-lan-without-stratus/</link>
		<comments>http://www.flashrealtime.com/local-flash-peer-to-peer-communication-over-lan-without-stratus/#comments</comments>
		<pubDate>Fri, 27 Aug 2010 12:20:39 +0000</pubDate>
		<dc:creator>tom</dc:creator>
		
		<category><![CDATA[Flash Media]]></category>

		<category><![CDATA[Tutorial]]></category>

		<category><![CDATA[actionscript]]></category>

		<category><![CDATA[as3]]></category>

		<category><![CDATA[flash]]></category>

		<category><![CDATA[ip-only]]></category>

		<category><![CDATA[lan]]></category>

		<category><![CDATA[multicast]]></category>

		<category><![CDATA[netgroup]]></category>

		<category><![CDATA[NetStream]]></category>

		<category><![CDATA[P2P]]></category>

		<category><![CDATA[peer-to-peer]]></category>

		<category><![CDATA[stratus]]></category>

		<guid isPermaLink="false">http://www.flashrealtime.com/?p=1803</guid>
		<description><![CDATA[
			
				
			
		
 Some of you guys were probably wondering how to establish P2P connections in the local network (LAN) without Stratus. Yes. It&#8217;s possible. Using native IP-only multicast. Let&#8217;s build a simple chat with Posting. Adding Multicast broadcast is just a simple next step which I am sure you can accomplish by yourself with few hints [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.flashrealtime.com%2Flocal-flash-peer-to-peer-communication-over-lan-without-stratus%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.flashrealtime.com%2Flocal-flash-peer-to-peer-communication-over-lan-without-stratus%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p><img src="http://www.flashrealtime.com/wp-content/uploads/2010/08/native-ip-multicast-small.png" alt="native-ip-multicast-small" title="native-ip-multicast-small" width="199" height="168" class="alignleft size-full wp-image-1804" /> Some of you guys were probably wondering how to establish P2P connections in the local network (LAN) without Stratus. Yes. It&#8217;s possible. Using native IP-only multicast. Let&#8217;s build a simple chat with Posting. Adding Multicast broadcast is just a simple next step which I am sure you can accomplish by yourself with few hints from <a href="http://www.flashrealtime.com/multicast-explained-flash-101-p2p/">my article about Multicast</a></p>
<p>Open an IP Multicast connection. This can be done by specifying connection string as &#8220;rtmpf:&#8221;. Note, that this technique cannot be used for one-to-one communication. So no DIRECT_CONNECTIONS with NetStream, but you can do all RTMFP Group operations.</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #0066CC;">netConnection</span>.<span style="color: #0066CC;">connect</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;rtmfp:&quot;</span><span style="color: #66cc66;">&#41;</span>;</pre></div></div>

<p><span id="more-1803"></span></p>
<p>Once you get connected (on <em>NetConnection.Connect.Success</em>) you can set up a NetGroup or NetStream via GroupSpecifier. Then just set <b>ipMulticastMemberUpdatesEnabled</b> to true, which is responsible for establishing local connections between peers call <b>addIPMulticastAddress</b> with a multicast address and port. Multicast address should begin with 224 at least and port should be higher than <strong>1024</strong> - that means: <strong>&#8220;224.0.0.0:1024&#8243;</strong>, but the general rule is the higher the better = unique.</p>
<p>For my example below I&#8217;ve chosen rather higher numbers.</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;">groupspec.<span style="color: #006600;">ipMulticastMemberUpdatesEnabled</span> = <span style="color: #000000; font-weight: bold;">true</span>;
groupspec.<span style="color: #006600;">addIPMulticastAddress</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;225.225.0.1:30303&quot;</span><span style="color: #66cc66;">&#41;</span>;</pre></div></div>

<p>Together it will look like this:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #0066CC;">connect</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span><span style="color: #66cc66;">&#123;</span>
	nc = <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #0066CC;">NetConnection</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
	nc.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>NetStatusEvent.<span style="color: #006600;">NET_STATUS</span>, netStatus<span style="color: #66cc66;">&#41;</span>;
	nc.<span style="color: #0066CC;">connect</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;rtmfp:&quot;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> netStatus<span style="color: #66cc66;">&#40;</span>event:NetStatusEvent<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span><span style="color: #66cc66;">&#123;</span>
	<span style="color: #b1b100;">switch</span><span style="color: #66cc66;">&#40;</span>event.<span style="color: #006600;">info</span>.<span style="color: #006600;">code</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
		<span style="color: #b1b100;">case</span> <span style="color: #ff0000;">&quot;NetConnection.Connect.Success&quot;</span>:
			setupGroup<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
			<span style="color: #b1b100;">break</span>;
	<span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> setupGroup<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span><span style="color: #66cc66;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">var</span> groupspec:GroupSpecifier = <span style="color: #000000; font-weight: bold;">new</span> GroupSpecifier<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;myGroup/groupOne&quot;</span><span style="color: #66cc66;">&#41;</span>;
	groupspec.<span style="color: #006600;">postingEnabled</span> = <span style="color: #000000; font-weight: bold;">true</span>;
	groupspec.<span style="color: #006600;">ipMulticastMemberUpdatesEnabled</span> = <span style="color: #000000; font-weight: bold;">true</span>;
	groupspec.<span style="color: #006600;">addIPMulticastAddress</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;225.225.0.1:30303&quot;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
	group = <span style="color: #000000; font-weight: bold;">new</span> NetGroup<span style="color: #66cc66;">&#40;</span>nc,groupspec.<span style="color: #006600;">groupspecWithAuthorizations</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
	group.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>NetStatusEvent.<span style="color: #006600;">NET_STATUS</span>,netStatus<span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<h3>Try app</h3>
<p><a href="http://flashrealtime.com/demos/p2pchatlocal/P2PChatLocal.html">P2PChatLocal</a> - open in two or more windows.</p>
<h3>Download</h3>
<p>You can download complete source code of a chat application here:<br />
<a href="http://flashrealtime.com/demos/p2pchatlocal/P2PChatLocal.mxml">P2PChatLocal.mxml</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.flashrealtime.com/local-flash-peer-to-peer-communication-over-lan-without-stratus/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Flash Summer Webinars This Week</title>
		<link>http://www.flashrealtime.com/flash-summer-webinars-this-week/</link>
		<comments>http://www.flashrealtime.com/flash-summer-webinars-this-week/#comments</comments>
		<pubDate>Sun, 22 Aug 2010 15:11:31 +0000</pubDate>
		<dc:creator>tom</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[as3]]></category>

		<category><![CDATA[connect]]></category>

		<category><![CDATA[P2P]]></category>

		<category><![CDATA[php]]></category>

		<category><![CDATA[swiz]]></category>

		<category><![CDATA[swiz framework]]></category>

		<category><![CDATA[webinar]]></category>

		<category><![CDATA[zend]]></category>

		<guid isPermaLink="false">http://www.flashrealtime.com/?p=1796</guid>
		<description><![CDATA[
			
				
			
		
Make sure you don&#8217;t miss following webinars this week prepared by Adobe Platform Evangelists. All of them will be live online using Screen Sharing technology via Adobe Connect Pro.
Especially if you are regular reader of my blog and interested in P2P, don&#8217;t miss Advanced P2P Programming on Friday - it will be summary of all [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.flashrealtime.com%2Fflash-summer-webinars-this-week%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.flashrealtime.com%2Fflash-summer-webinars-this-week%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>Make sure you don&#8217;t miss <a href="http://www.eventbrite.com/org/385269137?s=1985322">following webinars</a> this week prepared by Adobe Platform Evangelists. All of them will be live online using Screen Sharing technology via Adobe Connect Pro.</p>
<p>Especially if you are regular reader of my blog and interested in P2P, don&#8217;t miss <strong>Advanced P2P Programming on Friday</strong> - it will be summary of all my recent articles.</p>
<p>This week:</p>
<ul>
<li><a onclick="javascript:_gaq.push(['_trackEvent','outbound-article','doctrinezendflash.eventbrite.com']);" href="http://doctrinezendflash.eventbrite.com/" target="_blank">Summer Cocktail: Doctrine 2, Zend Framework, Flex, and Flash Builder</a> (Mihai Corlan)- Tuesday, August 24</li>
<li><a onclick="javascript:_gaq.push(['_trackEvent','outbound-article','advancedp2p.eventbrite.com']);" href="http://advancedp2p.eventbrite.com/" target="_blank">Advanced P2P programming in Flash</a> (Tom Krcha) – Friday, August 27</li>
</ul>
<p>Next week:</p>
<ul>
<li><a onclick="javascript:_gaq.push(['_trackEvent','outbound-article','flexandswiz.eventbrite.com']);" href="http://flexandswiz.eventbrite.com/" target="_blank">Presentation Model pattern with Flex and Swiz Framework</a> (Piotr Walczyszyn) – Tuesday, August 31, 2010</li>
</ul>
<p><a href="http://www.eventbrite.com/org/385269137?s=1985322">Register</a> for free.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.flashrealtime.com/flash-summer-webinars-this-week/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Screen Sharing Feature In Flash Now Available For Everyone!</title>
		<link>http://www.flashrealtime.com/screen-sharing-in-flash-now-available/</link>
		<comments>http://www.flashrealtime.com/screen-sharing-in-flash-now-available/#comments</comments>
		<pubDate>Tue, 17 Aug 2010 23:00:49 +0000</pubDate>
		<dc:creator>tom</dc:creator>
		
		<category><![CDATA[Flash Media]]></category>

		<category><![CDATA[Flash Player]]></category>

		<category><![CDATA[connect]]></category>

		<category><![CDATA[connectnow]]></category>

		<category><![CDATA[flash]]></category>

		<category><![CDATA[fms]]></category>

		<category><![CDATA[LCCS]]></category>

		<category><![CDATA[livecycle collaboration service]]></category>

		<category><![CDATA[screen sharing]]></category>

		<guid isPermaLink="false">http://www.flashrealtime.com/?p=1780</guid>
		<description><![CDATA[
			
				
			
		
 I can&#8217;t even say how much I was looking forward to this blog post. It&#8217;s here! This feature of Flash Player and special screensharing add-in, which you might know from Adobe Connect Pro or Adobe ConnectNow is now available for every single Flash Platform developer through LiveCycle Collaboration Service. This is THE KILLER FEATURE [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.flashrealtime.com%2Fscreen-sharing-in-flash-now-available%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.flashrealtime.com%2Fscreen-sharing-in-flash-now-available%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p><img src="http://www.flashrealtime.com/wp-content/uploads/2010/08/livecycle_collaboration_service_mnemonic_no_shadow.jpg" alt="livecycle_collaboration_service_mnemonic_no_shadow" title="livecycle_collaboration_service_mnemonic_no_shadow" width="120" height="120" class="alignleft size-full wp-image-1781" /> I can&#8217;t even say how much I was looking forward to this blog post. It&#8217;s here! This feature of Flash Player and special screensharing add-in, which you might know from <a href="http://www.adobe.com/products/acrobatconnectpro/">Adobe Connect Pro</a> or <a href="http://connectnow.acrobat.com">Adobe ConnectNow</a> is now available for every single Flash Platform developer through <a href="http://www.adobe.com/eeurope/products/livecycle/collaborationservice/">LiveCycle Collaboration Service</a>. This is THE KILLER FEATURE everyone, who is developing collaborative apps, was waiting for.</p>
<p>And I am happy to say: <strong>The waiting is over!</strong> You can now grab it and implement it right inside of your applications!</p>
<p><img src="http://www.flashrealtime.com/wp-content/uploads/2010/08/screen-shot-2010-08-18-at-125314-am.jpg" alt="screen-shot-2010-08-18-at-125314-am" title="screen-shot-2010-08-18-at-125314-am" width="480" height="366" class="alignleft size-full wp-image-1793" /></p>
<p><b>Try demo</b><br />
<a href="http://flashrealtime.com/demos/screenshare/ScreenSharePublisherFlashOnlyExample.html">Publisher</a> | <a href="http://flashrealtime.com/demos/screenshare/ScreenShareSubscriberFlashOnlyExample.html">Subscriber</a></p>
<p><a href="http://vimeo.com/14224560">See how it works at Vimeo</a>.</p>
<p>Source code is available in samples folder, which comes with <a href="http://afcs.acrobat.com">LCCS SDK Navigator</a>.<br />
<span id="more-1780"></span></p>
<p><b>How screensharing works?</b></p>
<p>The best way to try this is definitely one of the Acrobat.com services - <a href="http://connectnow.acrobat.com/">ConnectNow</a>, which is completely built with LiveCycle Collaboration Service components.</p>
<p><b>What do I need for this?</b></p>
<p>If you start sharing your screen, the Flash Player asks you to install ConnectNow Add-In. The installation process is very seemless, you just wait couple seconds until the progress bar directly in Flash Player installs this essential component and then you are ready to go.</p>
<p><b>I want to start developing my own Screen Sharing apps…</b></p>
<p>For this - you need to get an LCCS account. LCCS is a cloud hosted service by Adobe - just go to <a href="http://afcs.acrobat.com">LCCS Developer Portal</a>, create account, download SDK and start building your apps.</p>
<p>Once you install LCCS SDK Navigator (an AIR app), you can see some tutorials, which are part of it, deploy SDK or do other related stuff. I have also done a couple LCCS video tutorials in the past, you can <a href="http://flashrealtime.com/video-tutorials/">see them here</a>.</p>
<p><b>In LCCS API, you will find the new four classes:</b></p>
<p>- ScreenShareCanvas<br />
- ScreenSharePublisher<br />
- ScreenShareSubscriber<br />
- ScreenShareSubscriberComplex<br />
<a href="http://learn.adobe.com/wiki/display/lccs/8.3+Screen+Sharing">Read about Screen Sharing at LCCS learning resource</a></p>
<p>There are more things in the latest update - like recording. Please refer to article at official <strong>Adobe Collaborative Methods Blog</strong>:<br />
<a href="http://blogs.adobe.com/collabmethods/2010/08/screen-sharing-and-recording-august-feature-tsunami.html">Screen Sharing and Recording: August Feature TSUNAMI</a></p>
<p><em>Development tip: it might happen that you don&#8217;t connect correctly and it will not work. Use http instead of https in your connection string and it will be fixed.</em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.flashrealtime.com/screen-sharing-in-flash-now-available/feed/</wfw:commentRss>
<enclosure url="http://flashrealtime.com/demos/screenshare/recording.mov" length="11173718" type="video/quick" />
		</item>
		<item>
		<title>Video-on-Demand over P2P in Flash Player 10.1 with Object Replication</title>
		<link>http://www.flashrealtime.com/video-on-demand-over-p2p-in-flash-player-101-with-object-replication/</link>
		<comments>http://www.flashrealtime.com/video-on-demand-over-p2p-in-flash-player-101-with-object-replication/#comments</comments>
		<pubDate>Wed, 28 Jul 2010 17:56:19 +0000</pubDate>
		<dc:creator>tom</dc:creator>
		
		<category><![CDATA[Flash Player]]></category>

		<category><![CDATA[Tutorial]]></category>

		<category><![CDATA[actionscript]]></category>

		<category><![CDATA[as3]]></category>

		<category><![CDATA[flash]]></category>

		<category><![CDATA[fms]]></category>

		<category><![CDATA[object replication]]></category>

		<category><![CDATA[P2P]]></category>

		<category><![CDATA[stratus]]></category>

		<category><![CDATA[video]]></category>

		<category><![CDATA[vod]]></category>

		<guid isPermaLink="false">http://www.flashrealtime.com/?p=1727</guid>
		<description><![CDATA[
			
				
			
		
In the previous tutorial File Sharing over P2P in Flash Player 10.1 with Object Replication we went through the Object Replication basics. And you can see that the Receiver is requesting packets one by one. That&#8217;s not suitable for the real world app, but it&#8217;s good for testing on a LAN to see the progress. [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.flashrealtime.com%2Fvideo-on-demand-over-p2p-in-flash-player-101-with-object-replication%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.flashrealtime.com%2Fvideo-on-demand-over-p2p-in-flash-player-101-with-object-replication%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>In the previous tutorial <a href="http://www.flashrealtime.com/file-share-object-replication-flash-p2p/">File Sharing over P2P in Flash Player 10.1 with Object Replication</a> we went through the Object Replication basics. And you can see that the Receiver is requesting packets one by one. That&#8217;s not suitable for the real world app, but it&#8217;s good for testing on a LAN to see the progress. In the real world app, you can immediately request all packets using <em>NetGroup.addWantObjects(beginIndex, endIndex);</em>.</p>
<h3>Transferring VoD video over P2P</h3>
<p>Let&#8217;s get something real with Object Replication. The use-case I like most is a <strong>Realtime P2P Distributed System for Video-on-Demand</strong>.<br />
<img class="alignnone size-full wp-image-1734" title="Video-on-Demand P2P Object Replication Scheme" src="http://www.flashrealtime.com/wp-content/uploads/2010/07/vodp2p.png" alt="Video-on-Demand P2P Object Replication Scheme" width="480" height="324" /><br />
<span id="more-1727"></span><br />
This is the vision. It could be nicely integrated by video/news portals, especially on the currently most demanded videos (latest hits, hot news, etc.). When users are currently acquiring one video or a few hot videos from a server, why not try to lighten the load on the server and improve the viewers experience.</p>
<p>I am not afraid to say that <strong>this can save you millions </strong>or at least most of your video portal costs.</p>
<p><em>*Note: This is only a study how it could work. It still needs further work and testing.</em></p>
<h3>See how it works</h3>
<p><object width="480" height="270"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=13701681&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=ff9933&amp;fullscreen=1" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=13701681&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=ff9933&amp;fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="480" height="270"></embed></object>
<p>This technique shows how you can distribute VoD video with Flash Player 10.1 Object Replication</p>
<p><strong>Getting the video</strong><br />
To download a video file, you can use URLStream class. Register ProgressEvent to control every byte segment you get, while putting these segments together you can already start creating deliverable chunks (~64KB) for object replication. If you are on a slow network, you will probably get more segments to chunk, than on a fast network. This is illustrated below. It doesn&#8217;t matter, just keep in mind, that you need to wait until you can separate these segments into chunks.</p>
<p><strong>Sharing the video</strong><br />
While downloading, you can already start sharing the video in the P2P network using Object Replication. Once others receive packets, they start sharing them as well, while receiving the rest. This makes the network more stable and less dependent on a relatively low number of original providers.</p>
<p><strong>Viewing the video<br />
<span style="font-weight: normal;">Flash Player 10.1 added a new <em>NetStream </em>function called <em>appendBytes, </em>which enables you to pass a ByteArray containing FLV bytes to a NetStream and then display it. This was originally added for HTTP streaming, but we can leverage it nicely as well. <a href="http://www.bytearray.org/?p=1689">You can read more about it here.</a></span></strong></p>
<h3>Solution #1 (Basic)</h3>
<p><a href="http://flashrealtime.com/demos/p2pvod/Sender.html">Sender</a> | <a href="http://flashrealtime.com/demos/p2pvod/Receiver.html">Receiver</a> | <a href="http://flashrealtime.com/demos/p2pvod/tester-simple.html">Tester</a> (both in frames) | <a href="http://flashrealtime.com/demos/p2pvod/flight01.flv">FLV video for testing</a></p>
<p>In this demo, you browse for a FLV video on a local storage device; once you choose it, it starts providing packets for other peers.</p>
<p><img class="alignnone size-full wp-image-1752" title="sender-receiver" src="http://www.flashrealtime.com/wp-content/uploads/2010/07/sender-receiver.png" alt="sender-receiver" width="480" height="279" /></p>
<p>Basically, you cut video into chunks and start providing it using <em>NetGroup.addHaveObjects(0, 84);</em> - this video has 84 chunks. On the receiver side, you ask for a zero chunk, which is a file descriptor, using <em>NetGroup.addWantObjects(0,0);</em> In this descriptor you receive the total chunks count and you can add more info like file name, size, etc. Once you receive the zero chunk, you ask for the rest of the objects using <em>NetGroup.addWantObjects(1,84)</em>; and Flash Player will start receiving the rest of the packets after a few seconds.</p>
<p>Try opening the receiver in other 5 or more windows and you will find an error. There is no guarantee that packets are received one by one, they can be received in completely different order and for this, you will need a special buffer. More in Advanced solution below.</p>
<h3>Solution #2 (Advanced)</h3>
<div><a href="http://flashrealtime.com/demos/p2pvod/Main.html">App demo</a> | <a href="http://flashrealtime.com/demos/p2pvod/tester.html">Tester</a> (four apps)</div>
<p></p>
<div>This solution is the main concept of P2P VOD. One peer downloads a FLV video from a server using URLStream. While downloading, it starts providing the video for others and others starts receiving the video and providing as well.</div>
<p></p>
<div><img class="alignnone size-full wp-image-1753" title="app-demo" src="http://www.flashrealtime.com/wp-content/uploads/2010/07/app-demo.png" alt="app-demo" width="480" height="137" /></div>
<p><br/></p>
<h3>The Challenges</h3>
<p>There were couple challenges, which need to be addressed to make it work properly.</p>
<p><strong>Chunks<br />
<span style="font-weight: normal;">You need to split received bytes from URLStream to deliverable chunks. You have to wait until you receive at least one chunk (64KB) and than add it to an array. If you receive less, you wait, until you have 64 KB or more and then you add it. (So - First buffer). If you receive more than 64 KB in one progress event, you need to cut it in a cycle. So for instance if you receive 100 KB, you create one chunk (64 KB) and the rest (36 KB) you leave in the buffer to be filled (to at least 64 KB).  If you receive 200 KB (you create 3 chunks and keep 8 KB for the next batch). If you receive last bits of the data, which is in Event.COMPLETE, than you create just final chunk (which is always going to be less than 64 KB or same). All these things are done in URLByteLoader.as. Check especially createChunks() function.</strong><br />
<img src="http://www.flashrealtime.com/wp-content/uploads/2010/07/schema-file-receive-urlstream.png" alt="schema-file-receive-urlstream" title="schema-file-receive-urlstream" width="480" height="254" class="alignnone size-full wp-image-1763" /></p>
<p><strong>Download buffer for viewing</strong><br />
While downloading, I put chunks into a buffer, which is appended directly to the NetStream and then played in a Video object. This enables me to display video during the download process.</p>
<p><strong>Postponed buffer for P2P (put chunks together)</strong><br />
The biggest problem with receiving Object Replication packets is that there is no guarantee that you will receive packets in correct linear order one by one. Typically you receive packets a completely mixed order - e.g. 1,2,3,4,20,21,22,5,6,7 and so on. So you need a Timer that puts these packets together and waits for the next one in the line and then continues with appending bytes to the NetStream. This basically enables you to display video during the Object Replication process and you don&#8217;t have to wait until you receive all the packets before you start playing video.</p>
<p><strong>Deciding who is provider<br />
<span style="font-weight: normal;">In the real world, you will need to decide who is the provider and who is the receiver. Providers should be clients on the best uplink/downlink network. You can make a network check before playing video and then say that this client is going to be a provider. You can save this information in cookies with a corresponding expire time.</span></strong><strong></strong></p>
<h3>The Source</h3>
<p><a href="http://flashrealtime.com/demos/p2pvod/src.zip">Download here</a> (src.zip, 10 KB)</p>
<h3>Where to go from here</h3>
<p>Check out these other tutorials on P2P in Flash:</p>
<p>- <a href="http://www.flashrealtime.com/file-share-object-replication-flash-p2p/">File Sharing over P2P in Flash Player 10.1 with Object Replication</a><br />
- <a href="http://www.flashrealtime.com/p2p-groupspecifier-explained-1/ ">P2P GroupSpecifier Class Explained In Details Part 1</a><br />
- <a href="http://www.flashrealtime.com/multicast-explained-flash-101-p2p/">Multicast Explained in Flash 10.1 P2P</a><br />
- <a href="http://www.flashrealtime.com/directed-routing-explained-flash-p2p/">Directed Routing Explained in Flash 10.1 P2P</a><br />
- <a href="http://www.flashrealtime.com/simple-chat-p2p-netgroup-rtmfp/">Simple chat with P2P NetGroup in FP 10.1</a></p>
<p>Video tutorials:<br />
- <a href="http://www.flashrealtime.com/peer-to-peer-chat-netgroup-flash-player-101/">P2P Chat with NetGroup in Flash Player 10.1</a><br />
- <a href="http://www.flashrealtime.com/tutorial-multicast-streaming-in-flash-player-101/"> Multicast Streaming in Flash Player 10.1 Tutorial</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.flashrealtime.com/video-on-demand-over-p2p-in-flash-player-101-with-object-replication/feed/</wfw:commentRss>
		</item>
		<item>
		<title>AS3-P2P-LIB and P2P Video Calls on Android</title>
		<link>http://www.flashrealtime.com/as3-p2p-lib-and-p2p-video-calls-on-android/</link>
		<comments>http://www.flashrealtime.com/as3-p2p-lib-and-p2p-video-calls-on-android/#comments</comments>
		<pubDate>Thu, 22 Jul 2010 08:15:30 +0000</pubDate>
		<dc:creator>tom</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[android]]></category>

		<category><![CDATA[as3]]></category>

		<category><![CDATA[lib]]></category>

		<category><![CDATA[P2P]]></category>

		<category><![CDATA[video]]></category>

		<guid isPermaLink="false">http://www.flashrealtime.com/?p=1742</guid>
		<description><![CDATA[
			
				
			
		
I am very happy that the community is getting more and more involved in P2P. I told you, it has endless possibilities!  
AS3-P2P-LIB
AS3-P2P-LIB is a pure ActionScript 3.0 Library by Dominic Graefen that helps Flash developers get started with P2P easily.

All Classes &#124; Example &#124; Project page at GitHub
P2P Video Calls on Android
My fellow [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.flashrealtime.com%2Fas3-p2p-lib-and-p2p-video-calls-on-android%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.flashrealtime.com%2Fas3-p2p-lib-and-p2p-video-calls-on-android%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>I am very happy that the community is getting more and more involved in P2P. I told you, it has endless possibilities! <img src='http://www.flashrealtime.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><strong>AS3-P2P-LIB</strong><br />
AS3-P2P-LIB is a pure ActionScript 3.0 Library by <a href="http://devboy.org/">Dominic Graefen</a> that helps Flash developers get started with P2P easily.</p>
<p><a href="http://github.com/devboy/AS3-P2P-LIB"><img src="http://www.flashrealtime.com/wp-content/uploads/2010/07/as3-p2p-lib.png" alt="as3-p2p-lib" title="as3-p2p-lib" width="480" height="251" class="alignnone size-full wp-image-1743" /></a></p>
<p><a href="http://github.com/devboy/AS3-P2P-LIB/tree/master/org/devboy/toolkit/net/p2p">All Classes</a> | <a href="http://github.com/devboy/AS3-P2P-LIB/blob/master/Example.as">Example</a> | <a href="http://github.com/devboy/AS3-P2P-LIB">Project page at GitHub</a></p>
<p><strong>P2P Video Calls on Android</strong></p>
<p>My fellow evangelist Mark Doherty built a great demo app using P2P and <a href="http://labs.adobe.com/technologies/air/">AIR 2.5 for Android</a>. <a href="http://vimeo.com/13410620">Watch this video</a>, where he shows how it works. And btw: I should really teach him how to pronounce my name <img src='http://www.flashrealtime.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> Mark, you are going to get a lesson at MAX 2010!</p>
<p><object width="500" height="281"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=13410620&amp;server=vimeo.com&amp;show_title=0&amp;show_byline=0&amp;show_portrait=0&amp;color=00ADEF&amp;fullscreen=1" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=13410620&amp;server=vimeo.com&amp;show_title=0&amp;show_byline=0&amp;show_portrait=0&amp;color=00ADEF&amp;fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="500" height="281"></embed></object></p>
<p><a href="http://www.flashmobileblog.com/2010/07/17/p2p-video-calls-on-android/">Check Mark&#8217;s blog post</a> for further information.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.flashrealtime.com/as3-p2p-lib-and-p2p-video-calls-on-android/feed/</wfw:commentRss>
		</item>
		<item>
		<title>File Sharing over P2P in Flash Player 10.1 with Object Replication</title>
		<link>http://www.flashrealtime.com/file-share-object-replication-flash-p2p/</link>
		<comments>http://www.flashrealtime.com/file-share-object-replication-flash-p2p/#comments</comments>
		<pubDate>Wed, 14 Jul 2010 19:29:02 +0000</pubDate>
		<dc:creator>tom</dc:creator>
		
		<category><![CDATA[Tutorial]]></category>

		<category><![CDATA[flash]]></category>

		<category><![CDATA[Flash Media Server]]></category>

		<category><![CDATA[flash player 10.1]]></category>

		<category><![CDATA[fms]]></category>

		<category><![CDATA[object replication]]></category>

		<category><![CDATA[P2P]]></category>

		<category><![CDATA[peer-to-peer]]></category>

		<category><![CDATA[stratus]]></category>

		<guid isPermaLink="false">http://www.flashrealtime.com/?p=1646</guid>
		<description><![CDATA[
			
				
			
		
Read also: Video-on-Demand over P2P in Flash Player 10.1 with Object Replication
Object Replication
Object Replication is the most lowest-level P2P access available in Flash Player 10.1 (followed by Multicast, Posting and Directed Routing). It basically enables you to send chunks of data between peers. Object Replication is the only P2P access method that guarantees that all [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.flashrealtime.com%2Ffile-share-object-replication-flash-p2p%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.flashrealtime.com%2Ffile-share-object-replication-flash-p2p%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>Read also: <a href="http://www.flashrealtime.com/video-on-demand-over-p2p-in-flash-player-101-with-object-replication/">Video-on-Demand over P2P in Flash Player 10.1 with Object Replication</a></p>
<p><b>Object Replication</b></p>
<p>Object Replication is the most lowest-level P2P access available in Flash Player 10.1 (followed by <a href="http://www.flashrealtime.com/multicast-explained-flash-101-p2p/">Multicast</a>, <a href="http://www.flashrealtime.com/simple-chat-p2p-netgroup-rtmfp/">Posting</a> and <a href="http://www.flashrealtime.com/directed-routing-explained-flash-p2p/">Directed Routing</a>). It basically enables you to send chunks of data between peers. Object Replication is the only P2P access method that guarantees that all data will be transferred to all receiving peers. </p>
<p><img src="http://www.flashrealtime.com/wp-content/uploads/2010/07/swarming.jpg" alt="Swarming" title="Swarming" width="480" height="252" class="alignnone size-full wp-image-1661" /></p>
<h3><a href="http://flashrealtime.com/demos/p2pfileshare2/P2PFileSharing.html">Demo</a></h3>
<p>I&#8217;ve built <a href="http://flashrealtime.com/demos/p2pfileshare2/P2PFileSharing.html">this simple file sharing application</a>, which basically loads a file and then you start sharing it. Open another client to start receiving the file.<br />
<a href="http://flashrealtime.com/demos/p2pfileshare2/P2PFileSharing.html"><img src="http://www.flashrealtime.com/wp-content/uploads/2010/07/provider-receiver-demo.jpg" alt="provider-receiver-demo" title="provider-receiver-demo" width="480" height="241" class="alignnone size-full wp-image-1675" /><br />
</a><br />
<span id="more-1646"></span><br />
<em>How to use it:<br />
Open a provider in one window - browse for a file (JPG, PNG, GIF). Once it&#8217;s loaded, it will start sharing the file. Open a receiver in many other windows and start receiving. Provider and receiver are included in one app in this example.</em></p>
<h3>How does it work</h3>
<p>A classic scenario for Object Replication in Flash is file sharing. You have two clients, one is sending the data (Provider) and the other one receives the data (Receiver). You were able to <a href="http://cookbooks.adobe.com/post_Create_a_P2P_file_sharing_application-16539.html">do this already in Flash Player 10 using NetStream</a> - but this worked only for two clients and there where no replication of objects to the members of a group => Massive File Sharing! In our scenario, you can have thousands of receivers.</p>
<p><strong>Provider</strong><br />
Provides data for others. This is the originator. First you need to have an object with data you want to share. You most probably will load a file using URLStream or FileReference. Then you need to split this file into separate ByteArray chunks and give them indexes (it can be an indexed array). Keep the chunks reasonably small to avoid transfer issues (around 64KB). So if you load a 2 MB file, you will have 32 chunks. Finally call <em>NetGroup.addHaveObject(0, 32);</em> which says you have in this case 32 chunks available for others.</p>
<p><strong>Receiver</strong><br />
Receives data from a provider. Here you just call <em>NetGroup.addWantObjects(index, index);</em> and start receiving objects from the provider. I do this by keeping the increasing the index by 1 once received a chunk. So you basically call <em>NetGroup.addWantObjects(index, index);</em> 32 times. When you call addWantObjects, the Providers gets a status <em>&#8220;NetGroup.Replication.Request&#8221;</em>. At this point the provider needs to write data to a group using <em>NetGroup.writeRequestedObject(event.info.requestID,chunks[event.info.index])</em>. Once it writes the data, the Receiver gets a <em>&#8220;NetGroup.Replication.Fetch.Result&#8221;</em> status event and save the data locally to an object. Remember, that the Receiver is just receiving data, it is not providing the data to other peers. After it has received all chunks, the Receiver just goes through the chunks and put them together into a final ByteArray.</p>
<p><strong>Receiver/Provider</strong><br />
So why not to provide the received data to other peers to make the trasfer faster and maybe more stable. Once you receive some data using <em>NetGroup.addWantObjects(index, index);</em> and save them in <em>&#8220;NetGroup.Replication.Fetch.Result&#8221;</em>, you can start providing the data to other peers using <em>NetGroup.addHaveObject(index, index);</em>.</p>
<p>Of course there is lot more to be done, but first let&#8217;s have a look at this schema for the above.</p>
<p><img src="http://www.flashrealtime.com/wp-content/uploads/2010/07/schema-object-replication1.png" alt="schema object replication p2p flash" title="schema object replication p2p flash" width="480" height="508" class="alignnone size-full wp-image-1706" /></p>
<h3>Simple Object Replication</h3>
<p>To demonstrate how Object Replication works, let&#8217;s try this <a href="http://flashrealtime.com/demos/p2pfileshare2/P2PObjRep.html">second demo</a>. In this example you have an object, which we fill with and array of 100 elements. Then start sharing this array. Run the second client to start receiving the array.</p>
<p><strong>Provider peer:</strong><br />
1. Once connected, click <em>fillObject</em><br />
2. Then click <em>addHaveObjects</em><br />
3. That&#8217;s all</p>
<p><strong>Receiver peer:</strong><br />
1. Once connected, click <em>addWantObjects</em><br />
2. It should start receiving objects shortly<br />
(there is a loop, first chunk you receive is count of objects, once you receive a chunk the index increases by 1 and asks for next chunk until they are all received)</p>
<p>There are couple more buttons - you can try playing with it a little bit if you want.<br />
<a href="http://flashrealtime.com/demos/p2pfileshare2/P2PObjRep.html"><img src="http://www.flashrealtime.com/wp-content/uploads/2010/07/p2pobjrep.png" alt="p2pobjrep" title="p2pobjrep" width="480" height="522" class="alignnone size-full wp-image-1698" /></a></p>
<h3>How was it built?</h3>
<p>Once connected to a server setup a NetGroup instance like this:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> setupGroup<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span><span style="color: #66cc66;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">var</span> spec:GroupSpecifier = <span style="color: #000000; font-weight: bold;">new</span> GroupSpecifier<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;myGroup&quot;</span><span style="color: #66cc66;">&#41;</span>;
	spec.<span style="color: #006600;">serverChannelEnabled</span> = <span style="color: #000000; font-weight: bold;">true</span>;
	spec.<span style="color: #006600;">objectReplicationEnabled</span> = <span style="color: #000000; font-weight: bold;">true</span>;
&nbsp;
	netGroup = <span style="color: #000000; font-weight: bold;">new</span> NetGroup<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">netConnection</span>,spec.<span style="color: #006600;">groupspecWithAuthorizations</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
	netGroup.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>NetStatusEvent.<span style="color: #006600;">NET_STATUS</span>,netStatus<span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p>Once connected to a NetGroup, which means that user allowed P2P connections, UDP is enabled and so on - you do operations on a NetGroup. First set object replication strategy. We will be receiving packets one by one (moreless).</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;">netGroup.<span style="color: #006600;">replicationStrategy</span> = NetGroupReplicationStrategy.<span style="color: #006600;">LOWEST_FIRST</span>;</pre></div></div>

<p>In your netStatusHandler - catch two codes:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">// This code is called on a Provider</span>
<span style="color: #b1b100;">case</span> <span style="color: #ff0000;">&quot;NetGroup.Replication.Request&quot;</span>: 
	<span style="color: #808080; font-style: italic;">// calling this causes &quot;NetGroup.Replication.Fetch.Result&quot; invocation on a Receiver</span>
	netGroup.<span style="color: #006600;">writeRequestedObject</span><span style="color: #66cc66;">&#40;</span>event.<span style="color: #006600;">info</span>.<span style="color: #006600;">requestID</span>,obj<span style="color: #66cc66;">&#91;</span>event.<span style="color: #006600;">info</span>.<span style="color: #0066CC;">index</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span>
&nbsp;
	<span style="color: #b1b100;">break</span>;
&nbsp;
<span style="color: #808080; font-style: italic;">// This code is called on a Receiver</span>
<span style="color: #b1b100;">case</span> <span style="color: #ff0000;">&quot;NetGroup.Replication.Fetch.Result&quot;</span>:
        <span style="color: #808080; font-style: italic;">// received chunks can be already provided to others</span>
	netGroup.<span style="color: #006600;">addHaveObjects</span><span style="color: #66cc66;">&#40;</span>event.<span style="color: #006600;">info</span>.<span style="color: #0066CC;">index</span>,event.<span style="color: #006600;">info</span>.<span style="color: #0066CC;">index</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
        <span style="color: #808080; font-style: italic;">// write a chunk into an object/array</span>
	obj<span style="color: #66cc66;">&#91;</span>event.<span style="color: #006600;">info</span>.<span style="color: #0066CC;">index</span><span style="color: #66cc66;">&#93;</span> = event.<span style="color: #006600;">info</span>.<span style="color: #0066CC;">object</span>;
&nbsp;
	<span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span>event.<span style="color: #006600;">info</span>.<span style="color: #0066CC;">index</span> == <span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
		<span style="color: #808080; font-style: italic;">// First chunk (0) holds the number of chunks</span>
		objSize = <span style="color: #0066CC;">Number</span><span style="color: #66cc66;">&#40;</span>event.<span style="color: #006600;">info</span>.<span style="color: #0066CC;">object</span><span style="color: #66cc66;">&#41;</span>;
	<span style="color: #66cc66;">&#125;</span><span style="color: #b1b100;">else</span><span style="color: #66cc66;">&#123;</span>
		<span style="color: #808080; font-style: italic;">// Receive chunks until you are full</span>
		<span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span>event.<span style="color: #006600;">info</span>.<span style="color: #0066CC;">index</span>+<span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&lt;</span>objSize<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
			netGroup.<span style="color: #006600;">addWantObjects</span><span style="color: #66cc66;">&#40;</span>event.<span style="color: #006600;">info</span>.<span style="color: #0066CC;">index</span>+<span style="color: #cc66cc;">1</span>,event.<span style="color: #006600;">info</span>.<span style="color: #0066CC;">index</span>+<span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span>;
			actualFetchIndex = event.<span style="color: #006600;">info</span>.<span style="color: #0066CC;">index</span>+<span style="color: #cc66cc;">1</span>;
		<span style="color: #66cc66;">&#125;</span>
	<span style="color: #66cc66;">&#125;</span>
	<span style="color: #b1b100;">break</span>;</pre></div></div>

<p><a href="http://flashrealtime.com/demos/p2pfileshare2/src/P2PObjRep.mxml">The whole source code can be found here</a>.</p>
<h3>Creating ByteArray P2P File Sharing</h3>
<p>By following the concept above it&#8217;s possible to load a file from disk or url and then start sharing it with others.</p>
<p>This explains how the <a href="http://flashrealtime.com/demos/p2pfileshare2/P2PFileSharing.html">first demo works</a>.</p>
<p>For this I&#8217;ve split the application into four different classes:</p>
<p><b><a href="http://flashrealtime.com/demos/p2pfileshare2/src/LocalFileLoader.as">LocalFileLoader.as</a></b><br />
Loads a file using FileReference and splits it into chunks (~64 KB each).</p>
<p><b><a href="http://flashrealtime.com/demos/p2pfileshare2/src/P2PFileShare.as">P2PFileShare.as</a></b><br />
Connects to Stratus and handles all Object Replication sending and receiving</p>
<p><b><a href="http://flashrealtime.com/demos/p2pfileshare2/src/P2PSharedObject.as">P2PSharedObject.as</a></b><br />
A simple value object, which holds the data (ByteArray), size, packetLenght, actualFetchIndex and chunks; it&#8217;s used by both classes above. </p>
<p><b><a href="http://flashrealtime.com/demos/p2pfileshare2/src/P2PFileSharing.mxml">P2PFileSharing.mxml</a></b><br />
The user interface, which puts it all together.</p>
<p>The <a href="http://flashrealtime.com/demos/p2pfileshare2/src/P2PFileSharing.zip">complete source code can be found here</a>.</p>
<p>The <strong>Provider</strong> should look like this after sending the data:<br />
<img src="http://www.flashrealtime.com/wp-content/uploads/2010/07/p2pprovider.png" alt="p2pprovider" title="p2pprovider" width="480" height="411" class="alignnone size-full wp-image-1701" /></p>
<p>The <strong>Receiver</strong> should look like this after receiving the data:<br />
<img src="http://www.flashrealtime.com/wp-content/uploads/2010/07/p2preceiver.png" alt="p2preceiver" title="p2preceiver" width="480" height="399" class="alignnone size-full wp-image-1702" /></p>
<p>In the next tutorial, I will look at how to use Object Replication with VOD video.</p>
<h3>Where to go from here</h3>
<p>Check other tutorials on P2P in Flash:</p>
<p>- <a href="http://www.flashrealtime.com/video-on-demand-over-p2p-in-flash-player-101-with-object-replication/">Video-on-Demand over P2P in Flash Player 10.1 with Object Replication</a><br />
- <a href="http://www.flashrealtime.com/p2p-groupspecifier-explained-1/ ">P2P GroupSpecifier Class Explained In Details Part 1</a><br />
- <a href="http://www.flashrealtime.com/multicast-explained-flash-101-p2p/">Multicast Explained in Flash 10.1 P2P</a><br />
- <a href="http://www.flashrealtime.com/directed-routing-explained-flash-p2p/">Directed Routing Explained in Flash 10.1 P2P</a><br />
- <a href="http://www.flashrealtime.com/simple-chat-p2p-netgroup-rtmfp/">Simple chat with P2P NetGroup in FP 10.1</a></p>
<p>Video tutorials:<br />
- <a href="http://www.flashrealtime.com/peer-to-peer-chat-netgroup-flash-player-101/">P2P Chat with NetGroup in Flash Player 10.1</a><br />
- <a href="http://www.flashrealtime.com/tutorial-multicast-streaming-in-flash-player-101/"> Multicast Streaming in Flash Player 10.1 Tutorial</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.flashrealtime.com/file-share-object-replication-flash-p2p/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Interview with Chris Scott (Swiz Framework)</title>
		<link>http://www.flashrealtime.com/interview-with-chris-scott-swiz-framework/</link>
		<comments>http://www.flashrealtime.com/interview-with-chris-scott-swiz-framework/#comments</comments>
		<pubDate>Wed, 14 Jul 2010 13:52:30 +0000</pubDate>
		<dc:creator>tom</dc:creator>
		
		<category><![CDATA[Conferences]]></category>

		<category><![CDATA[chris scott]]></category>

		<category><![CDATA[Flex]]></category>

		<category><![CDATA[framework]]></category>

		<category><![CDATA[interview]]></category>

		<category><![CDATA[swiz]]></category>

		<category><![CDATA[swiz framework]]></category>

		<category><![CDATA[tom krcha]]></category>

		<guid isPermaLink="false">http://www.flashrealtime.com/?p=1680</guid>
		<description><![CDATA[
			
				
			
		
Chris Scott (author of Swiz Framework) visited Prague and while here, he did a very nice presentation about Swiz at the Adobe User Group Meeting. We were lucky to have him here and before his UG session, we did a little interview.
Here it is (Watch on Vimeo):

]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.flashrealtime.com%2Finterview-with-chris-scott-swiz-framework%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.flashrealtime.com%2Finterview-with-chris-scott-swiz-framework%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p><a href="http://twitter.com/asstrochris">Chris Scott</a> (author of <a href="http://swizframework.jira.com/wiki/display/SWIZ/Home">Swiz Framework</a>) visited Prague and while here, he did a very nice presentation about Swiz at the Adobe User Group Meeting. We were lucky to have him here and before his UG session, we did a little interview.</p>
<p>Here it is (<a href="http://vimeo.com/13339986">Watch on Vimeo</a>):</p>
<p><object width="500" height="281"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=13339986&amp;server=vimeo.com&amp;show_title=0&amp;show_byline=0&amp;show_portrait=0&amp;color=00ADEF&amp;fullscreen=1" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=13339986&amp;server=vimeo.com&amp;show_title=0&amp;show_byline=0&amp;show_portrait=0&amp;color=00ADEF&amp;fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="500" height="281"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://www.flashrealtime.com/interview-with-chris-scott-swiz-framework/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Chris Scott of Swiz is coming to Prague</title>
		<link>http://www.flashrealtime.com/chris-scott-swiz-is-coming-to-prague/</link>
		<comments>http://www.flashrealtime.com/chris-scott-swiz-is-coming-to-prague/#comments</comments>
		<pubDate>Fri, 09 Jul 2010 16:52:35 +0000</pubDate>
		<dc:creator>tom</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.flashrealtime.com/?p=1657</guid>
		<description><![CDATA[
			
				
			
		
Don&#8217;t miss the next Prague Adobe User Group Meeting on Tuesday 13th July 18:00-20:00.
I really recommend this meeting as it&#8217;s a great chance to meeting an independent ActionScript expert from USA, ask advanced questions and so on.
Chris Scott is an Enterprise Software Consultant in the Philadelphia area with over ten years of Java, ColdFusion, ActionScript [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.flashrealtime.com%2Fchris-scott-swiz-is-coming-to-prague%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.flashrealtime.com%2Fchris-scott-swiz-is-coming-to-prague%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>Don&#8217;t miss the next Prague Adobe User Group Meeting on <strong>Tuesday 13th July 18:00-20:00</strong>.</p>
<p>I really recommend this meeting as it&#8217;s a great chance to meeting an independent ActionScript expert from USA, ask advanced questions and so on.</p>
<p>Chris Scott is an Enterprise Software Consultant in the Philadelphia area with over ten years of Java, ColdFusion, ActionScript and Flex experience as well as a strong interest in the implementation of open source solutions. Chris is the lead developer of the <a href="http://code.google.com/p/swizframework/">Swiz Framework</a> and the ColdSpring Framework, including the first Aspect Oriented Programming framework for ColdFusion.</p>
<p>Address: <strong>Adobe Praha, Radlická 714/113a</strong></p>
<p>More info in Czech at <a href="http://www.viktorbezdek.cz/2010/07/setkani-s-chrisem-scottem-autorem-frameworku-swiz/">Viktor&#8217;s blog</a>.</p>
<p><a href="http://groups.adobe.com/index.cfm?event=post.display&#038;postid=28829">Meeting info at Adobe Groups</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.flashrealtime.com/chris-scott-swiz-is-coming-to-prague/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
