2 Replies Latest reply: Mar 1, 2010 7:46 AM by turbidity RSS

    Need Help with broadcastMsg in the FMS Admin API

    turbidity Community Member

      Anyone have any experience using broadcastMsg in the FMS Admin API? I am making an RTMP call to this method to call a method in an application. The broadcastMsg method always returns a success for me, even if I call a non-existent method. The method in the app I am trying to call is called getClientIPs. When I call this method from a standard NetConnection.call(), it works fine and traces a result in the app's Live Log in the FMS Admin Console. However, it seems to never be called by broadcastMsg. I never see any output in the Live Log using this method.

       

      Here is how my method is configured in my application:

       

      Client.prototype.getClientIPs = function()

      {

          trace( 'ip is 127.0.0.1' );

          ips = new Array();

          ips.push( '127.0.0.1' );

          return ips;

      }

       

      I have tried defining on the application object as well as in the root scope, to no avail. Does anyone have any suggestions as to how I can get the method to be called by broadcastMsg in the Admin API? Also, can I even get a value returned using this method? I want to bring client IPs into my FMS Admin app.

       

      Thanks!

        • 1. Re: Need Help with broadcastMsg in the FMS Admin API
          JayCharles Community Member

          According to the docs, the admin command braodcastMsg broadcasts to clients, not to applications. That would explain why it's not calling the application method. Also, there's nothing in the broadcatMsg method that supports returning of data. The docs suggest that there is no responder structure... and that makes sense to me (looks like broadcastMsg does just what the name implies... it just broadcasts a message).

           

          If you need to get results back from the application, Im fairly certain you need to invoke an RMI on the application directly, but I don't see anything in the admin API that supports such an operation.

           

          Perhaps there's another approach you can take here. Can you describe what it is you're trying to accomplish?

          • 2. Re: Need Help with broadcastMsg in the FMS Admin API
            turbidity Community Member

            Hi, Jay. Thanks for the reply! I was hoping that it would be called on client objects in the FMS application. I have tried creating a getClientIPs address on a client object attached to the NetConnection, but didn't have luck calling that either (not that it would help me, but I was curious if it would work). As for the responder, I saw that there was no inherent way to do it and was dismayed, but what I hoped is that because you can pass in extra parameters for the method that are passed to the method on the client, I could pass a responder object to the client method as one of those extra parameter and it would get used as a responder just like in using NetConnection.call().

             

            What I'm trying to accomplish is to be able to display the IP addresses for all clients attached to a given application or application instance. It seems that the IP is only available in the FMS application itself on the server-side client object. I certainly can do a standard RMI for the method from my app, but wanted to avoid opening and closing NetConnections for each application to get this one tidbit of data. It is an easy workaround, but not as satisfying or efficient as being able to do it all through the Admin API.