简体   繁体   English

Red5-独立地从应用程序服务器调用客户端方法

[英]Red5 - Invoking client methods from application server independantly

How would you invoke a client flash method from application server in java applicationadapter. 您将如何从Java applicationadapter中的应用程序服务器调用客户端flash方法。 I know how to invoke client flash methods from application server when adding this to flash client: 我知道将其添加到Flash Client时如何从应用程序服务器调用Client Flash方法:

        var responseText:Responder = new Responder(GetYourStreamingTicket);

        nc.call("GetYourStreamingTicket",responseText,ui_main.txt_username.text, ui_main.lbl_Category.text);

        private function GetYourStreamingTicket(object:Object)
        {
        var val:int = object as int;
        ui_main.lbl_yst.text = val;
        }

but the above is really sending a request to the server from flash client and the server responding to the request, but how do you make an independent call from java application server to client flash? 但是上面的内容实际上是从Flash客户端向服务器发送请求,并且服务器响应该请求,但是如何从Java应用程序服务器向客户端Flash进行独立调用?

Basically i ask this question because i want all the users connected to the server now when i client has disconnected. 基本上我问这个问题是因为当客户端断开连接时,我希望所有用户现在都连接到服务器。

CLIENT-SIDE 客户端

 var rtmpNow:String="rtmp://192.168.1.2/chatter";
  nc=new NetConnection;
  nc.client = this;

  public function DisconnectedUser()
  {
   trace("User Disconnected")
  }

SERVER-SIDE 服务器端

  public void appLeave(IClient client, IScope app)
  {
    for(Iterator e = users.iterator(); e.hasNext();)
        {
        User user = (User) e.next();
        IConnection conn = user.conn;
        ((IServiceCapableConnection) conn).invoke("DisconnectedUser");  
    }
  }

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM