title: Red5 - Invoking client methods from application server doesn't work
body: <p>how would you invoke a client flex method from application in red5-service-1.0.5-RELEASE appliocation .</p>
  
  <pre><code>and my jdk version is 1.8(64-bit).flex 4 ,as3
  
   package org.red5.demos;
  
          import org.red5.server.adapter.ApplicationAdapter;
          import org.red5.server.api.IConnection;
          import org.red5.server.api.scope.IScope;
          import org.red5.server.api.service.IServiceCapableConnection;
          import org.red5.server.api.stream.IServerStream;
  
          /**
           * @author user
           *
           */
          public class Application extends ApplicationAdapter {
  
              private IScope appScope;
              private IServerStream serverStream;
  
              @Override
              public boolean appStart(IScope app){
  
                  super.appStart(app);
                  System.out.println("hello demo start");
                  appScope=app;
                  return true;
              }
  
  
              @Override
              public boolean appConnect(IConnection conn,Object[]obj){  
  
                  IScope appScope=conn.getScope();
  
                  System.out.println("appConnect");
  
                  callient(conn); //appConnect and calling client method
  
                  return super.appConnect(conn, obj);
  
              }
  
  
              private void callient(IConnection conn){
                  if(conn instanceof IServiceCapableConnection){
                      System.out.println("connect to flash side");    
                      ((IServiceCapableConnection) conn).invoke("yourFunctionInFlash");   // involing client side method ,but print "connect to flash side"
                  }
              }
  
      //disconnected
              @Override
              public void appDisconnect(IConnection conn){
                      if(appScope==conn.getScope() &amp;&amp; serverStream!=null){
                          serverStream.close();
                      }
                  super.appDisconnect(conn);
              }
          }
  </code></pre>
  
  <p>and my flex side code,in my demo ,,after connect to red5 server application ,the netStatus info is success.</p>
  
  <pre><code>        &lt;?xml version="1.0" encoding="utf-8"?&gt;
          &lt;s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009" 
                                 xmlns:s="library://ns.adobe.com/flex/spark" 
                                 xmlns:mx="library://ns.adobe.com/flex/mx"                         creationComplete="windowedapplication1_creationCompleteHandler(event)"&gt;
  
  
              &lt;fx:Script&gt;
                  &lt;![CDATA[
                      import mx.events.FlexEvent;
                      import mx.graphics.codec.JPEGEncoder;
  
                      private var cam:Camera;
                      private var netConnection:NetConnection;
                      private var netStream:NetStream;**strong text**
  
                      protected function windowedapplication1_creationCompleteHandler(event:FlexEvent):void
                      {               
                          netConnection=new NetConnection();
                          netConnection.client = { onBWDone: function():void{} };         
                                      netConnection.addEventListener(NetStatusEvent.NET_STATUS,connectionServerHandler);          
                          netConnection.connect("rtmp://192.168.61.132/Hello","ssl");//connect to Hello App
                      }
  
                      public function sayHello(reponder:String):void{
                          trace(reponder+"from server side ");
                      }
  
                      public function yourFunctionInFlash():void{
                          trace("hello");  //get message from server side
                      }
  
                      private function connectionServerHandler(event:NetStatusEvent):void{
                          trace(event.info.code);  //it work success 
                      }
  
                  ]]&gt;
              &lt;/fx:Script&gt;
  
          &lt;/s:WindowedApplication&gt;
  
   but now ,flex side yourFunctionInFlash()method doesn't work,and server side also print "connect to flash side"message?&gt;&gt;&gt; is any other I have missed？
  
  
          thank you a lot .
  </code></pre>