6 Replies Latest reply on Nov 10, 2010 8:51 AM by Michael Thornburgh

    NetStream.send() doesn't work, but NetGroup.post() works correctly.

    SentimentalSea

      I have an application (web chat) and looks like it works correctly for most of computers.

      But recently I've tried to test my applicaion from my office computer and I've confronted with following issue:

      I can publish my video/audio stream to group, but I can't play streams from group peers.

      Also NetGroup.post() works correctly (I can send/receive text messages).

        • 1. Re: NetStream.send() doesn't work, but NetGroup.post() works correctly.
          Michael Thornburgh Adobe Employee

          have you enabled multicast in the group (GroupSpecifier.multicastEnabled = true)?  that is required for publishing/playing a stream in a group.

          • 2. Re: NetStream.send() doesn't work, but NetGroup.post() works correctly.
            SentimentalSea Level 1

            This is my group config:

            var groupSpec:GroupSpecifier = new GroupSpecifier(_groupSpec);
            groupSpec.serverChannelEnabled = true;
            groupSpec.multicastEnabled = true;
            groupSpec.postingEnabled = true;
            groupSpec.routingEnabled = true;
            groupSpec.objectReplicationEnabled = true;

            As I mentioned above for most of computers web chat works pretty good (publish/play video stream, posting messages). Problem computer in my office uses router, but UDP traffic is enabled (torrent works good). But nevertheless...could router configuration be a problem? I wanna remind that problem computer can publish, but couldn't play stream.

             

            Thanks a lot.

            • 3. Re: NetStream.send() doesn't work, but NetGroup.post() works correctly.
              Michael Thornburgh Adobe Employee

              when you say your problem computer "can publish", do you mean that other computers can receive the published stream?

               

              also in your original message you say that NetGroup.post() works (both sending and receiving).

               

              if you can receive postings on the problem computer, and other computers can receive a P2P multicast from it, then bidirectional communication is working and there's a non-networking reason that you're not receiving the multicast NetStreams.  perhaps a timing issue not waiting for NetStream.Connect.Success before issuing a NetStream.play() or something.  also i've found that multicast NetStreams *must* have a client object or there will be playback issues (especially in the unpublish/republish case).

              1 person found this helpful
              • 4. Re: NetStream.send() doesn't work, but NetGroup.post() works correctly.
                SentimentalSea Level 1

                also i've found that multicast NetStreams *must* have a client object or there will be playback issues (especially in the unpublish/republish case).

                What does 'client object' mean? I just use NetConnection property for bot in/out streams:

                private function initOutcomingStream():void
                        {           
                         
                            _nc.client = this;
                               ...
                        }

                private function initIncomingStream(peer:String):void
                        {           
                           ...               
                           _nc.client = this;
                          ...
                         }

                Should NetStream client object be a dynamic class?

                public dynamic class TestClient
                {
                    public function TestClient()
                    {
                        this.onPeerConnect = _onPeerConnect;
                    }

                    public function _onPeerConnect(ns:NetStream):Boolean
                    {
                        return true;
                    }
                }
                ...
                _ns.client = new TestClient;
                • 5. Re: NetStream.send() doesn't work, but NetGroup.post() works correctly.
                  SentimentalSea Level 1

                  when you say your problem computer "can publish", do you mean that other computers can receive the published stream?


                  Yes.

                  also in your original message you say that NetGroup.post() works (both sending and receiving).

                  Yes.

                  • 6. Re: NetStream.send() doesn't work, but NetGroup.post() works correctly.
                    Michael Thornburgh Adobe Employee

                    the most important thing is that the NetStream have *any* client object (even "new Object" is better than nothing).  the default behavior of at least one callback/event on the NetStream (its own client when none is set) appears to interfere with multicast playback.

                     

                    in the multicast case, as soon as you receive NetStream.Connect.Success, try setting

                     

                       netStream.client = new Object;

                     

                    before you issue your netStream.play(streamname) and see if that makes a difference.