8 Replies Latest reply on Jan 15, 2014 2:22 PM by Michael Thornburgh

    Not getting nearNonce from RTMFP Connection

    dshaw002

      I made a 2way videochat app that worked about 6 months ago. Now, it's not working. The users are connecting to the Cirrus server (I also update my developer key, etc.), but they are not able to communicate or share video with each other.

      I noticed in my debug code, however, that the nearID was being generated, but the nearNonce wasn't. I also noticed that the contents of the connection were mostly null.

      Any idea why my RTMFP connections aren't generating a nearNonce for the users?

        • 1. Re: Not getting nearNonce from RTMFP Connection
          Michael Thornburgh Adobe Employee

          are you receiving a NetConnection.Connect.Success event?  the nonces (on the NetConnection object) will/can only be generated when the RTMFP connection opens -- it is derived from cryptographic material negotiated during session startup.

          • 2. Re: Not getting nearNonce from RTMFP Connection
            dshaw002 Level 1

            Yes, I am. But for some reason, not the nearNonce... This is my output:

             

            NetConnection.Connect.Success

            You are connected to CB!

            NetStream.Publish.Start

            You are now transmitting video

            Your nearNonce:

            Your nearID: f5f7a37489e23107355c47bb3b93ae05611ae8cddf37e455e34918c1b14798a8

            Your info: currentBytesPerSecond=0 byteCount=0 maxBytesPerSecond=0 audioBytesPerSecond=0 audioByteCount=0 videoBytesPerSecond=0 videoByteCount=0 dataBytesPerSecond=0 dataByteCount=0 playbackBytesPerSecond=0 droppedFrames=0 audioBufferLength=0 videoBufferLength=0 dataBufferLength=0 audioBufferByteLength=0 videoBufferByteLength=0 dataBufferByteLength=0 srtt=0 audioLossRate=0 videoLossRate=0 metaData=null xmpData=null uri=rtmfp://p2p.rtmfp.net/43bd9134c43e1c95dba9ef1a-XXXXXXXXX/ resourceName=null isLive=true

            registerSuccess

            You are now in the meeting room

            • 3. Re: Not getting nearNonce from RTMFP Connection
              Michael Thornburgh Adobe Employee

              if you're trying to get the nearNonce from the NetStream of a 1:1 (directConnections) stream, then you need to get it from the peer NetStream, not the original publishing one.

               

              if you're trying to get the nearNonce from the NetConnection object, then 1) that should work and 2) that's not very interesting when connecting to Cirrus.

               

              note that there are no nonces on group (multicast) NetStreams.

              • 4. Re: Not getting nearNonce from RTMFP Connection
                dshaw002 Level 1

                It's weird, because it worked before, but then it stopped working.. I also used the new cirrus service.

                 

                protected function NetStatusHandler(e:NetStatusEvent):void

                                    {

                                              //trace(e.info.code);

                                              statusMsg( e.info.code );

                                              switch (e.info.code)

                                              {

                                                        case "NetConnection.Connect.Success":

                                                                  connectButton.enabled = false;

                                                                  statusMsg("You are connected to CB!");

                                                                  initSendStream();

                                                                  break;

                                                        case "NetConnection.Connect.Closed":

                                                                  break;

                                                        case "NetStream.Publish.Start":

                                                                  //trace("You are now transmitting video");

                                                                  statusMsg( "" );

                                                                  statusMsg( "You are now transmitting video" );

                                                                  connectButton.label = "Connected";

                                                                  streamConnected = true;

                                                                  userNearID = netConnection.nearID;

                                                                  //statusMsg("Your audioReliable: " + outgoingStream.audioReliable);

                                                                  //statusMsg("Your audioSampleAccess: " + outgoingStream.audioSampleAccess);

                                                                  //statusMsg("Your backBufferLength: " + outgoingStream.backBufferLength);

                                                                  //statusMsg("Your backBufferTime: " + outgoingStream.backBufferTime);

                                                                  //statusMsg("Your bufferLength: " + outgoingStream.bufferLength);

                                                                  //statusMsg("Your bufferTime: " + outgoingStream.bufferTime);

                                                                  //statusMsg("Your bufferTimeMax: " + outgoingStream.bufferTimeMax);

                                                                  //statusMsg("Your bytesLoaded: " + outgoingStream.bytesLoaded);

                                                                  //statusMsg("Your bytesTotal: " + outgoingStream.bytesTotal);

                                                                  //statusMsg("Your checkPolicyFile: " + outgoingStream.checkPolicyFile);

                                                                  //statusMsg("Your client: " + outgoingStream.client);

                                                                  //statusMsg("Your currentFPS: " + outgoingStream.currentFPS);

                                                                  //statusMsg("Your dataReliable: " + outgoingStream.dataReliable);

                                                                  //statusMsg("Your farID: " + outgoingStream.farID);

                                                                  //statusMsg("Your farNonce: " + outgoingStream.farNonce);

                                                                  //statusMsg("Your inBufferSeek: " + outgoingStream.inBufferSeek);

                                                                  statusMsg("Your nearNonce: "+ outgoingStream.nearNonce);

                                                                  statusMsg("Your nearID: " +netConnection.nearID);

                                                                  connectSuccess();

                                                                  break;

                                                        case "NetStream.Connect.Closed":

                                                                  //trace("FarID for closed connection: " + e.info.stream.farID);

                                                                  statusMsg( "FarID for closed connection: " + e.info.stream.farID );

                                                                  if(e.info.stream.farID != userNearID)

                                                                  {

                                                                            if(netStreamClosed == false)

                                                                            {

                                                                                      netStreamClosed = true;

                                                                                      OnDisconnect();

                                                                            }

                                                                  }

                                                                  break;

                                              }

                                    }

                 

                protected function initSendStream():void

                                    {

                                              //reset values... maybe if you get disconnected...?

                                              incomingString = "empty";

                                              outgoingString = "empty";

                 

                 

                                              outgoingStream = new NetStream(netConnection, NetStream.DIRECT_CONNECTIONS);

                                              outgoingStream.addEventListener(NetStatusEvent.NET_STATUS, NetStatusHandler);

                                              outgoingStream.publish("media");

                                              statusMsg("Your info: " + outgoingStream.info);

                                              initCamera();

                                    }

                 

                Is there something I'm doing wrong or do you need more info?

                • 5. Re: Not getting nearNonce from RTMFP Connection
                  Michael Thornburgh Adobe Employee

                  where you're doing statusMsg("Your nearNonce: "+ outgoingStream.nearNonce), you're using the main publishing NetStream rather than the per-peer sub-NetStream. cycle the through the "peerStreams" on outgoingStream and show the nearNonces of those.

                  • 6. Re: Not getting nearNonce from RTMFP Connection
                    Michael Thornburgh Adobe Employee

                    also, don't publish your developer key.  i XXXXXXX-ed out part of it in your post above.

                    • 7. Re: Not getting nearNonce from RTMFP Connection
                      dshaw002 Level 1

                      The peerStreams didn't output anything. There's also something weird happening. I tried out the cirrus sample with two computers on the network at http://labs.adobe.com/technologies/cirrus/samples

                       

                      and they both connected (separate laptops) and the call worked and they got each other's nearID's, but they're not connecting with each other. (can't get stream from other, and the chat doesn't work). I'm going to try a different network, or two separate networks.

                       

                      Here are my stats from cc.rtmfp.com for comps on my network:

                       

                      knows public IP address of self [no]

                      public udp port # same as local UDP port # [no]

                      can receive from same IP address, same UDP port number [yes]

                      can receive from same IP address, different UDP port number [no]

                      can receive from different IP address, different UDP port number [no]

                      can send to different IP address after server introduction [yes]

                      source ip address is preserved from original connection [yes]

                      source udp port number is preserved from original connection [yes]

                      • 8. Re: Not getting nearNonce from RTMFP Connection
                        Michael Thornburgh Adobe Employee

                        your cc result shows a port restricted cone NAT.  if both computers are behind the same NAT, P2P could fail for a number of reasons including:

                         

                          * the peers don't know their behind-NAT IP addresses and can't report them to Cirrus (Flash Player for Chrome Pepper has this problem)

                         

                          * one or both peers have a local firewall

                         

                        given the report from cc above, i would predict P2P should work with one computer behind that NAT and a peer on a different network, as long as the peer isn't behind a symmetric NAT (different translations for each peer).