4 Replies Latest reply on Sep 3, 2012 2:38 PM by RoyalWD

    Auto get farID

    tomk94

      Hello.

       

      First of all: sorry for my bad english.

       

      I am busy to build a chat application in Flash Builder 4 with Stratus. I want if 1 user put the nearID of the other user in the farID field, that the other user automatic connected to the user who did that. But the netConnection.farID is different then the real farID. How can i get the good farID?

       

      Thanx,

       

      Tom

        • 1. Re: Auto get farID
          Michael Thornburgh Adobe Employee

          the NetConnection.farID is the ID of the RTMFP server to which you're connected.

           

          the NetStream.farID of the subscribing/playing peer should match the NetConnection.nearID of the publishing peer.  on the publishing end, the publishing NetStream has a property "peerStreams", which contains a separate NetStream for each connected subscribing peer.  a member of that array will have a farID that matches the nearID of the subscribing peer.

           

          -mike

          • 2. Re: Auto get farID
            RoyalWD

            could you please write the codes of how to get the secondly connected peer's nearID automatically..

             

            and automatically using that secondly connected peer's nearID as a farID to finally establish a p2p connection between them..

             

            (without copy and pasting eachothers nearIDs manually to establish p2p connection)

             

            i dont know is it possible but i have read many many titles and subject about p2p and heard about onPeerConnect etc. but i never been successful..

             

            i just want to create an app like that when peerA runs the swf and after that peerB runs the same swf, i want to get p2p connection between them without copying and pasting nearIds and without NetGroup cause i want a direct connection between peers..

             

            is it possible ? if the answer is yes, please teach me how ? please write here the correct and working codes of a simple app of my wishes.. i am searching and reading for weeks

            • 3. Re: Auto get farID
              Michael Thornburgh Adobe Employee

              the cirrus sample application uses a web service to store and look up peer IDs associated with a name.

              • 4. Re: Auto get farID
                RoyalWD Level 1

                hmm ok maybe i can use shared object at fms instead of a web service..

                 

                could you please show me the correct usage of onPeerConnect and how it works ?