5 Replies Latest reply on May 17, 2011 1:13 PM by Michael Thornburgh

    Check if a stream id is valid

    haim_bert

      Hi.

      Is there a way i can validate that a publish name and id are registerd in the server? For instance im publishing a stream on one end and before playing that stream from another place i want to check if it is still available.

       

      Also, is there any expiration period for a publish stream id?

       

      Thanks.

        • 1. Re: Check if a stream id is valid
          Michael Thornburgh Adobe Employee

          by "stream id" do you mean a peer ID for 1:1 P2P communication, or a client-server publish to FMS?

           

          if you mean "can i tell that a particular peer is still connected to the Cirrus service?", then the answer is "not directly".  if you mean "can i tell if a named stream is currently being published to FMS?", you'll need to ask on the FMS forum.

          • 2. Re: Check if a stream id is valid
            haim_bert Level 1

            I mean peer id for p2p.

             

             

            " if you mean "can i tell that a particular peer is still connected to the Cirrus service?", then the answer is "not directly" "

            What do u mean by not directly?

             

            And what about experation? does a peer id have expiration date? if i publish for instace a peer id. can i play that stream after a week?

            • 3. Re: Check if a stream id is valid
              Michael Thornburgh Adobe Employee

              by "not directly" i mean there is no API for asking Cirrus "is a given peer ID currently connected".  the only way to really tell is to try to make a P2P connection to that peer and see if it succeeds.

               

              peer IDs don't "expire" exactly.  a peer ID exists for as long as that peer's NetConnection is connected to a server (such as Cirrus).  when you close the NetConnection, the peer ID is destroyed.  it no longer exists and will never be re-used.

               

              P2P streams are always live.  a stream exists as long as a peer is actively publishing it.  if the publishing peer stops publishing a P2P stream, or if the publishing peer goes away, then the stream is no longer available from that peer.

              1 person found this helpful
              • 4. Re: Check if a stream id is valid
                haim_bert Level 1

                Thank you.

                Do you perhaps know what will actullay happen in the action script code when i try to connect to a stream that dosent exists? does it throw some kind of excpetion or raises an event?

                • 5. Re: Check if a stream id is valid
                  Michael Thornburgh Adobe Employee

                  if you connect to an active valid peer ID but NetStream.play() an invalid stream name, nothing will happen (just like if you had done that with FMS).  the reason is that peer could publish that named stream in the future, and that's OK.

                   

                  if you specify a bad or dead peer ID, you will eventually (after a timeout of about 90 seconds) get a NetStream.Connect.Closed event.  likewise you'll get that event if you were connected to a peer but that peer then goes away.