2 Replies Latest reply on Jan 26, 2010 1:38 PM by Sean S Murphy

    File Sharing?


      Hi I am just beginning to research RTMFP and Stratus, and wanted to ask the community if it was possible using these technologies (or other adobe technologies) to be able to send a file between two Adobe AIR applications directly p2p.  I do understand that there are some cases where the p2p connection cannot be established.  I am not worried about that because in those cases I can use a file server.  I just wanted to make sure that RTMFP and Startus would allow an AIR application to send files in this manner?


      Any help or sugggestions would be greatly appreciated.

      Thank You.

      H. Baxton

        • 1. Re: File Sharing?
          Michael Thornburgh Adobe Employee

          there's nothing in RTMFP or Stratus that would stop you.  in AIR you have convenient file system access (unlike in Flash Player, where it's file-at-a-time, must fit entirely in memory, and all file access goes through a file chooser dialog; all of which, by the way, are features ).


          while it's *possible* to transfer files of arbitrary size using RTMFP, P2P NetStreams and NetStream.send(), the NetStream.send() API wasn't intended for bulk file transfers and doesn't really have any feedback into ActionScript to let you know how much data is in buffer or when it might be time to send more, AND NetStream.send() data is prioritized quite high (just below audio, but above video).  if you sent the whole thing at once with NetStream.send(), it would all end up in memory, which might not work if the file is "big".  you can use application layer feedback to meter out segments of the file (application layer acknowledgements in ActionScript)


          if you can use AIR 2 (in beta right now), you can use the new RTMFP Groups feature we call "Object Replication" (check the NetGroup API reference for addHaveObjects/addWantObjects and related events), break your file up into reasonable sized chunks (we recommend 16KB..64KB) and send it using that system.  that'll keep a reasonable number of segments in flight at once, and with AIR you can fetch the segments off disk (and write them to disk on the receiver) gradually instead of all at once.  using Object Replication also opens up the possibility of doing a multi-point/multi-participant cooperative file transfer.  finally, Object Replication has the lowest RTMFP priority, so it's basically "background" which is what you want for bulk data transfer.


          for more information on Object Replication, please see this thread from a few weeks ago:





          • 2. Re: File Sharing?
            Sean S Murphy

            I haven't gotten the chance to look into the new features of stratus 2.0 but I'll probably end up doing a training on it as soon as 10.1 isn't in beta anymore. But I did do a simple file sharing app for our Users Group, and I have the code up. You can find the post I did on making it here, and the online app here. Just as a side note, the file transfer on my app doesn't work very well for large files. I've been meaning to modify it to send in chunks, but I haven't had the chance yet. Here is a forum post about that.