[Red5] client side call method does not work

David Fragoso Cháidez david_fragoso_chaidez at yahoo.com.mx
Fri Jul 24 16:50:38 PDT 2009


well Walter, I will follow your advice...
thanks

--- El vie 24-jul-09, Walter Tak <walter at waltertak.com> escribió:

De:: Walter Tak <walter at waltertak.com>
Asunto: Re: [Red5] client side call method does not work
A: red5 at osflash.org
Fecha: viernes 24 de julio de 2009, 17:58



 
 

Perhaps you want to define Billete's onResult 
before you make the call. If the call completes before onResult is being 
initialised ... 
 
Anyway 3 tips:
 
1. rename local language into English so more ppl 
on this list can read it and perhaps help you
2. switch to ActionScript 3. AS3 has been out for 3 
years now and AS2 was buggy, dirty and is slow compared to AS3
3. most questions, answers and examples you find 
online are in given in AS3

  ----- Original Message ----- 
  From: 
  David Fragoso Cháidez 
  
  To: red5 at osflash.org 
  Sent: Saturday, 25 July 2009 00:39
  Subject: Re: [Red5] client side call 
  method does not work
  

  
    
    
      It is not Action Script 3, is Action Script 2.
Billete 
        is just an arbitrary object, it is not extended class... 
I was 
        modifying the function because onStatus was saying the 
        message:
NetConnection.call.Failed.
I modified by trial and 
        error...

This is the original function:

function 
        Llamada()
{ var Billete:Object = new Object();
  
        Servidor.call("Respuesta", Billete, "¿Quien vive...");
  
        Billete.onResult = function(mensaje)
     { 
        trace("Ottis dice: " + mensaje);
     
        }
};

OnStatus throws the following 
        message
NetConnection.call.Failed.

On the server side, i 
        modified this 
        function:

                
        public String Respuesta(String 
        parametros)
                              
        { 
        log.info(parametros);
                                
        return "¿Qué pasó 
        pelao";
                              
        }

...but does not work...

Which is the correct way to do 
        it?
--- El vie 24-jul-09, Sascha Sauren 
        <sascha.sauren at googlemail.com> escribió:

        
De:: 
          Sascha Sauren <sascha.sauren at googlemail.com>
Asunto: Re: 
          [Red5] client side call method does not work
A: 
          red5 at osflash.org
Fecha: viernes 24 de julio de 2009, 7:16


          btw also if "billette" is a extended responder 
          class there are the () missing
for the new constructor... just saw 
          that yet


2009/7/24 Sascha Sauren <sascha.sauren at googlemail.com>:
> 
          first... from flash you send a String but expect a ObjectArray may 
          use
> the same type on bothe sides??
>
> 
          second
> i guess u use ActionScript 3??
> is "Billete" an 
          extended responder class?
>
> 
          greetz
>
>
>
>
> 2009/7/24 David Fragoso 
          Cháidez <david_fragoso_chaidez at yahoo.com.mx>:
>> 
          Hi, I'm beginner.
>> I have created an simple application 
          that tries to make a call of the flash
>> client to red5 
          server  and receive a response of red5 towards the 
          flash
>> client.
>>
>> this is the java 
          server side:
>>
>>   1 package 
          conexion;
>>   2
>>   3 import 
          org.red5.server.api.service.IServiceCapableConnection;
>> 
            4 import 
          org.red5.server.adapter.ApplicationAdapter;
>>   5 
          import org.red5.server.api.*;
>>   6 import 
          org.slf4j.Logger;
>>   7 import 
          org.slf4j.LoggerFactory;
>>   8
>>   9 
          public class Application extends ApplicationAdapter
>> 
           10              
          { public Application()
>> 
           11                       
          {
>> 
           12                       
          }
>>  13
>> 
           14                
          public boolean appStart(IScope ambito)
>> 
           15                               
          { log.info("Iniciando Pininos...");
>> 
           16                                 
          return super.appStart(ambito);
>> 
           17                               
          }
>> 
           18                
          public void appDisconnect(IConnection id)
>> 
           19                            
          { super.appDisconnect(id);
>> 
           20                            
          }
>> 21
>> 
           22                
          //este método se activa con el primer cliente que se
>> 
          conecta a Pininos
>> 
           23                
          public boolean roomStart(IScope ambito)
>> 
           24                               
          { if(super.roomStart(ambito) == false)
>> 
           25                                   
          { return false;
>> 
           26                                   
          }
>> 
           27                                 
          log.info("Se ha conectado el primer
>> cliente a 
          Pininos...");
>> 
           28                                 
          return true;
>> 
           29                               
          }
>>  30
>> 
           31                 
          //este método se activa cada vez que un cliente se
>> conecta 
          a Pininos
>> 
           32                
          public boolean roomConnect(IConnection id, Object
>> 
          parametros[])
>> 
           33                               
          { if(super.roomConnect(id, parametros) ==
>> 
          false)
>> 
           34                                   
          { return false;
>> 
           35                                   
          }
>> 
           36                                 
          log.info("Se ha conectado un cliente a
>> 
          Pininos...");
>>  37
>> 
           38                                 
          IConnection cliente =
>> 
          Red5.getConnectionLocal();
>> 
           39                                 
          if(cliente instanceof
>> 
          IServiceCapableConnection)
>> 
           40                                   
          { IServiceCapableConnection sc =
>> 
          (IServiceCapableConnection) cliente;
>> 
           41                                     
          sc.invoke("conectado", new
>> Object[]{"Uno", 
          1});
>> 
           42                                   
          }
>> 
           43                                 
          return true;
>> 
           44                                
          }
>>  45
>> 
           46                
          //este método se activa cada vez que un cliente se
>> 
          desconecta de Pininos
>> 
           47                
          public void roomDisconnect(IConnection id)
>> 
           48                            
          { super.roomDisconnect(id);
>> 
           49                              
          log.info("Se ha desconectado un cliente de
>> 
          Pininos...");
>> 
           50                            
          }
>>  51
>> 
           52                
          //Method to be called from the client
>> 
           53                
          public String Respuesta(Object[] parametros)
>> 
           54                              
          { log.info(parametros[0].toString());
>> 
           55                                
          return "¿Qué pasó pelao";
>> 
           56                              
          }
>> 
           57              
          }
>>
>>
>> and here the actionscript client 
          side:
>>
>> Servidor = new 
          NetConnection();
>> Servidor.val = 
          this;
>>
>> Servidor.onStatus = 
          function(mensaje)
>> { trace(mensaje.code);
>> 
            if(mensaje.code == "NetConnection.Connect.Success")
>> 
             { trace("Mirad que se ha conectao");
>> 
               this.val.Llamada();
>>    
          }
>> }
>>
>> 
          Servidor.connect("rtmp://172.20.102.90:1935/Pininos");
>>
>> 
          function Llamada()
>> { Servidor.call("Respuesta", new 
          Billete, "¿Quien vive...");
>>   Billete.onResult = 
          function(mensaje)
>>      { trace("Ottis 
          dice: " + mensaje);
>>      }
>> 
          };
>>
>> Servidor.conectado = function()
>> 
          { trace("¿Quehubole queso...");
>> 
          }
>>
>>
>> the onStatus method 
          says:
>> 
          NetConnection.Connect.Success
>>
>> the Llamada() 
          function attempt to call to Respuesta (server side) but it
>> 
          does not work.
>> Where I'm 
          wrong?
>>
>>
>> 
          ________________________________
>> ¡Obtén la mejor 
          experiencia en la web!
>> Descarga gratis el nuevo Internet 
          Explorer 8.br>
>> http://downloads.yahoo.com/ieak8/?l=mx
>> 
          _______________________________________________
>> Red5 
          mailing list
>> Red5 at osflash.org
>> http://osflash.org/mailman/listinfo/red5_osflash.org
>>
>>
>
_______________________________________________
Red5 
          mailing list
Red5 at osflash.org
http://osflash.org/mailman/listinfo/red5_osflash.org


  
  
¡Obtén la mejor experiencia en la 
  web!
Descarga gratis el nuevo Internet Explorer 8.br> 
  http://downloads.yahoo.com/ieak8/?l=mx 
  
  

  _______________________________________________
Red5 mailing 
  list
Red5 at osflash.org
http://osflash.org/mailman/listinfo/red5_osflash.org

  
  

  Internal Virus Database is out-of-date.
Checked by AVG. 
Version: 
  7.5.560 / Virus Database: 270.12.26/2116 - Release Date: 15-05-09 
06:16

-----Sigue archivo adjunto-----

_______________________________________________
Red5 mailing list
Red5 at osflash.org
http://osflash.org/mailman/listinfo/red5_osflash.org



      ¡Obtén la mejor experiencia en la web! Descarga gratis el nuevo Internet Explorer 8. http://downloads.yahoo.com/ieak8/?l=mx
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://osflash.org/pipermail/red5_osflash.org/attachments/20090724/eef1aa5a/attachment-0001.html>


More information about the Red5 mailing list