3 Replies Latest reply on Oct 15, 2010 9:35 AM by nimigeanu

    How to unpublish a Multicast Stream ??

    rajdeeprath Level 1

      Hi I have a simple p2p application where i send multicast streams from every user to every user. My code is as shown below:

       

       

      if(modelLocator.stream == null)
      modelLocator.stream = new NetStream(modelLocator.netConnection,modelLocator.streamGroupSpecifier.groupspecWithAuthorizations());
      
      modelLocator.stream.publish("somename");
      

       

       

      Now this code works perfectly and publish works: ie: I get - NetStream.Publish.Start

      And when i try to close this stream i use the following code:

       

       

       

      modelLocator.stream.attachCamera(null);
      modelLocator.stream.attachAudio(null);
      modelLocator.stream.close();
      
      

       

      Even this works as expected and i get: NetStream.Unpublish.Success.

       

      But when i try to publish the stream again by running the first code, ie:  

       

       

       

      if(modelLocator.stream == null)
      modelLocator.stream = new NetStream(modelLocator.netConnection,modelLocator.streamGroupSpecifier.groupspecWithAuthorizations());
      
      modelLocator.stream.publish("somename");
      

       

      I get error: NetStream.Publish.BadName , this is what i dont understand. I dtopped the stream properly, then why is this showing up ??