Skip to main content
June 19, 2011
Answered

Contradiction in Developer Guide about what is instance?

  • June 19, 2011
  • 1 reply
  • 478 views

Hi!

On page 16 of developer guide it is said that the structure of URL is follows

protocol:[//host][:port]/appname/[instanceName]

But earlier on this page it was said that

The NetConnection class connects a client to an application instance on the server.

and an example was given

var nc:NetConnection = new NetConnection();

nc.connect("rtmp://localhost/HelloServer");

where the connect directive does not contain instance name.

So, how these relates? Does instance name is just omited in example meaning _definst_?

Is it possible to write

nc.connect("rtmp://localhost/HelloServer/room1");

?

Thanks.

    This topic has been closed for replies.
    Correct answer Nikhil_Kalyan

    Hi,

    Your understanding is almost correct and there is no contradiction regarding the instance and URL in the Developer guide.


    As it said, the net connection always connects to an instance of an application, this instance can be explicitly mentioned (as you wanted to add room1) or if it is not given, FMS uses a default instance with the identity _definst_ for all its purposes. You do not need to append this _definst_ in your connection URLs or elsewhere, but its what the connection goes to.

    If you see the administration console for FMS, you can observe clearly what instance is getting the connections.

    So, protocol:[//host][:port]/appname/[instanceName] is complete with explicit instance name in the URL.

    The NetConnection class connects a client to an application instance on the server. : Correct

    nc.connect("rtmp://localhost/HelloServer"); // it connects to _definst_

    nc.connect("rtmp://localhost/HelloServer/room1"); // possible and connected to instance room1.

    Hope it helps. Thank you !

    1 reply

    Nikhil_Kalyan
    Nikhil_KalyanCorrect answer
    Participating Frequently
    June 20, 2011

    Hi,

    Your understanding is almost correct and there is no contradiction regarding the instance and URL in the Developer guide.


    As it said, the net connection always connects to an instance of an application, this instance can be explicitly mentioned (as you wanted to add room1) or if it is not given, FMS uses a default instance with the identity _definst_ for all its purposes. You do not need to append this _definst_ in your connection URLs or elsewhere, but its what the connection goes to.

    If you see the administration console for FMS, you can observe clearly what instance is getting the connections.

    So, protocol:[//host][:port]/appname/[instanceName] is complete with explicit instance name in the URL.

    The NetConnection class connects a client to an application instance on the server. : Correct

    nc.connect("rtmp://localhost/HelloServer"); // it connects to _definst_

    nc.connect("rtmp://localhost/HelloServer/room1"); // possible and connected to instance room1.

    Hope it helps. Thank you !