3 Replies Latest reply on Dec 3, 2012 2:17 PM by sonesh.dabhi

    onStreamData not triggered


      I was trying to send a cutom Object from a publisher to subscribers over RTMFP.


        spec = new GroupSpecifier(_groupSpec);

                                    spec.serverChannelEnabled = true;

                                    spec.routingEnabled = true;

                                    spec.postingEnabled = true; 

                                    spec.multicastEnabled = true;

                                    spec.ipMulticastMemberUpdatesEnabled = true; 

                                    netGroup = new NetGroup(netConnection,spec.groupspecWithAuthorizations());


      //At the publisher side:


      ns = new NetStream(netConnection);

      ns.dataReliable = true;



      ns.send("onStreamData", myObject);


      //At the subscriber side:

      ns = new NetStream(netConnection);

      ns.addEventListener(NetStatusEvent.NET_STATUS, onNetStatus);

      ns.addEventListener(NetDataEvent.MEDIA_TYPE_DATA, onStreamData);



      public function onStreamData(event:NetDataEvent):void {

                                    var netStream:NetStream = event.target as NetStream;

                                    trace( "Data event from " + netStream.info.uri + " at " + event.timestamp );



      The subscriber connects to the netGroup successfully in trace, but onStreamData is not triggered.

        • 1. Re: onStreamData not triggered

          I am having a similar issue . Did you figure out why this is happening ?

          • 2. Re: onStreamData not triggered
            Michael Thornburgh Adobe Employee

            netStream.send() is totally supported on multicast NetStreams.  the NetStream.dataReliable property is ignored for multicast -- everything in the multicast is subject to the reliability implied by the multicastWindowDuration.


            the code you pasted above is not correct and not complete.  your NetStreams must be created with a groupspec to be a multicast stream.  the way it appears there it is a client-server NetStream. if the server is Cirrus, then it doesn't support client-server streaming like AMS does.


            you need to set the .client property on the subscribing NetStream to an object with an onStreamData method if you want it to be called in response to a NetStream.send().


            multicast streams do not support "data keyframes".

            • 3. Re: onStreamData not triggered
              sonesh.dabhi Level 1

              Michael I really appreciate your help .


              Yes I have set stream with groupspec for multicasting .


              It's really strange it works on Cirrus when I used ns.send("onStreamData", myObject); with multicast . But on my own server the handler method is not called . Not sure if any configuration is needed .


              Here is my code for custom publisher and receiver I created :


              Publisher : http://pastebin.com/Nn8nDdcA

              Viewer : http://pastebin.com/AfzykECw


              I will really apreciate your help as I have been trying to fix this for really long .