Skip to main content
Inspiring
August 23, 2007
Answered

Newbie to FMS 2

  • August 23, 2007
  • 8 replies
  • 808 views
On Machine A: I have Apache and Flash Media Server 2 Developer Ed.
When I test my app ( called testApp1 ) everything works fine.
But, when I test it on Machine B over the LAN, it hangs for a long time, I get, NetConnection.Connect.Failed and then the browser crashes. Very annoying.

Any idea what I might be doing wrong? I can post my code if you need to see it as well.

Thanks in advance for any help!

    This topic is closed to new replies. Start a new post to keep the conversation going.
    Correct answer Sergio Eurico
    quote:

    Originally posted by: pwyon
    So, no one is going to help? I am still having the problem. And it is driving me nuts! I am new to this and could really use a point in the right direction. I've completely turned off both of my firewalls and it still won't work. Is it something to with this code below?

    ----code----


    nc.connect( "rtmp://192.168.#.#/testApp1" ); //change last two numbers
    //my other attempt
    //nc.connect( "rtmp:/testApp1" );


    ----code----


    Hi, have you tried to call using the port number 1935?

    try this

    nc.connect( "rtmp://192.168.#.#:1935/testApp1" );


    -- Sergio Eurico

    8 replies

    Participant
    September 2, 2007
    Hi all,

    i am having the same problem of streaming flv file over internet.
    I am tryng to stream an flv file over internet.
    i have followed each and every step from the following tutorial: http://www.mcalister.cc/ddd/flv/index.html
    and when i run the html page on LAn, my flv file is streamng perfectly, but when try to run the same html file from the internet i dont see anything on the page except for the box of flash player.

    can any 1 tell me why my FLV file is working on LAN only. Why it is not working from internet, although ive no firwall problem on the FMS2 AND IIS machine?
    pwyonAuthor
    Inspiring
    August 28, 2007
    Sergio Eurico,
    It Works! Thanks a million. I also had to set up my firewall on machine B to stop blocking that port as well. Once again, thanks.
    Participant
    August 31, 2007
    hi,

    I've been tearing my hair out with the same, or very similar problem....

    I built a simple flash media app to stream some live audio, which is being encoded by Flash Media Encoder and published to a Flash Media server on the same machine, but hosted remotely from my client/player. Basically I want to make the stream available to Internet users.

    I'm serving the html/swf files locally.

    When the FMS is hosted in the same LAN as the html/swf files, it all works. BUT when I take the FMS and host it remotely, the NetConnection fails. Firewall ports all checked and apparently ok.

    I did an Ethereal trace which shows the client making a TCP connection to port 1935 (RTMP) and reaching the server, but the server TCP is returning a TCP RST (reset).

    I haven't tried specifying the port 1935 in the nc.connect(), but will give it a try. But don't see why it should make a difference given I can see from the trace my packets are going to TCP port 1935.

    The FMS2 documentation does point out that Net.connect will fail if the html/swf is served from a different domain than the domain the FMS resides. But having read up more about FM player "sandboxing" it seems the only way to ensure both client and server are in the same security sandbox is to serve the html/swf files from the same machine as the FMS2. But then that severely limits flexibility and is contrary to much of what is described by the documentation in terms of being able to host the FMS and html/swf on physically different machines.

    Anyone out there with any clues??

    thanks in advance!
    pwyonAuthor
    Inspiring
    August 27, 2007
    Sergio Eurico
    Hey. Thanks for the info. I'll surely give it a try. I'll let you know what happens.
    I hope it works...

    Thanks,
    pwyon
    pwyonAuthor
    Inspiring
    August 25, 2007
    So, no one is going to help? I am still having the problem. And it is driving me nuts! I am new to this and could really use a point in the right direction. I've completely turned off both of my firewalls and it still won't work. Is it something to with this code below?

    ----code----


    nc.connect( "rtmp://192.168.#.#/testApp1" ); //change last two numbers
    //my other attempt
    //nc.connect( "rtmp:/testApp1" );


    ----code----
    Sergio EuricoCorrect answer
    Participant
    August 27, 2007
    quote:

    Originally posted by: pwyon
    So, no one is going to help? I am still having the problem. And it is driving me nuts! I am new to this and could really use a point in the right direction. I've completely turned off both of my firewalls and it still won't work. Is it something to with this code below?

    ----code----


    nc.connect( "rtmp://192.168.#.#/testApp1" ); //change last two numbers
    //my other attempt
    //nc.connect( "rtmp:/testApp1" );


    ----code----


    Hi, have you tried to call using the port number 1935?

    try this

    nc.connect( "rtmp://192.168.#.#:1935/testApp1" );


    -- Sergio Eurico
    August 24, 2007
    Perhaps there's a firewall in the way somewhere... either on Machine A, Machine B, or your router. Try opening port 1935 on your firewalls.

    Also, when you connect from machine B, what hostname are you using? The LAN IP of machine A, or your WAN IP?
    pwyonAuthor
    Inspiring
    August 24, 2007
    JayCharles,
    Yeah, I have tried messing w/ the firewalls and port 1935 for some time now. I have had no luck with that at all. The ip im using in code is for Machine A's LAN IP: 192.168.#.# I've also tried using: rtmp:/testApp1 , and still no luck. Here's the code that works on Machine A ( which has FMS2 Dev. and Apache ):

    ----code below----

    import flash.net.NetConnection;
    import flash.events.NetStatusEvent;
    import flash.events.AsyncErrorEvent;
    import flash.events.SecurityErrorEvent;

    import flash.events.MouseEvent;
    import flash.events.Event;

    import flash.net.SharedObject;
    import flash.events.SyncEvent;


    var nc:NetConnection = new NetConnection();
    var so:SharedObject;



    //CONNECT=========================================================================
    nc.objectEncoding = ObjectEncoding.AMF0;
    //circle_so.objectEncoding = ObjectEncoding.AMF0;

    nc.addEventListener( NetStatusEvent.NET_STATUS , netStatusHandler );
    nc.addEventListener( AsyncErrorEvent.ASYNC_ERROR , asyncErrorHandler );
    nc.addEventListener( SecurityErrorEvent.SECURITY_ERROR , securityErrorHandler );

    nc.connect( "rtmp://192.168.#.#/testApp1" ); //change last two numbers
    //my other attempt
    //nc.connect( "rtmp:/testApp1" );

    function asyncErrorHandler( aee:AsyncErrorEvent ){
    StatusText.text = aee.toString();
    }//end function

    function securityErrorHandler( see:SecurityErrorEvent ){
    StatusText.text = see.toString();
    }//end function

    function netStatusHandler( nse:NetStatusEvent ){
    StatusText.text = nse.info.code;
    if( nse.info.code == "NetConnection.Connect.Success" ){
    light.gotoAndStop( 2 ); //green
    so = SharedObject.getRemote( "position" , nc.uri );
    so.addEventListener( SyncEvent.SYNC , syncHandler );
    so.connect( nc );
    }else{
    light.gotoAndStop( 1 ); //red
    }//end if
    }//end function

    function syncHandler( se:SyncEvent ){
    for( var i:Number = 0 ; i < se.changeList.length ; i++ ){
    updateCircle();
    }//end for
    }//end function
    //CONNECT=========================================================================


    //CIRCLE==========================================================================
    function updateCircle( ){
    circle.x = so.data.dx;
    circle.y = so.data.dy;
    }//end function

    circle.addEventListener( MouseEvent.MOUSE_DOWN , mouseDownHandler );
    circle.addEventListener( MouseEvent.MOUSE_UP , mouseUpHandler );

    function mouseDownHandler( me:MouseEvent ){
    circle.startDrag( false );
    circle.addEventListener( MouseEvent.MOUSE_MOVE , mouseMoveHandler );
    }//end function

    function mouseUpHandler( me:MouseEvent ){
    circle.stopDrag();
    circle.removeEventListener( MouseEvent.MOUSE_MOVE , mouseMoveHandler );
    }//end function

    function mouseMoveHandler( me:MouseEvent ){
    updateSO( circle );
    }//end function

    function updateSO( mc:MovieClip ){
    so.setProperty( "dx" , circle.x );
    so.setProperty( "dy" , circle.y );
    }//end function
    //CIRCLE==========================================================================
    ---end code---

    I think that's about it. It's just a simple app where if you move the ball, it updates in the other browser windows as well.