Hi,

I am new in working on Red5 server.
I want to make a java client which could hit the red5 server and get the
result.
I have deployed the application on server and that is working fine.

I have tested the same application with Flash Client. Thats OK.
Now I want to simulate the same thing with JAVA client. I have found RTMP
client for that.
I have tried out that.
Below is the attached code, but not getting the resutl.

Server side code:

import org.red5.server.adapter.ApplicationAdapter ;
import org.red5.server.api.IConnection;

public class test extends ApplicationAdapter {
   
    public boolean appConnect(IConnection conn, Object[] params) {
         log.fatal("testClient: client connected");
          return super.appConnect(conn,params);
  }
   
    public Double add(Double a, Double b){
        return a + b;
    }

}


Client side code:


 import org.red5.server.api.service.IPendingServiceCall ;
import org.red5.server.api.service.IPendingServiceCallback;
import org.red5.server.net.rtmp.RTMPClient;

 /**
     * A simple client simulation
     */
 public class Test  {
     
   
   
   
     
     public static void main(String[] args) {

   
         RTMPClient client = new RTMPClient();
         IPendingServiceCallback _callback = new MyCallback();
          client.connect ("127.0.0.1",1935,"amit");
            Object[] params = new Object[2];
            params[0] = new Double(2);
            params[1] = new Double(3);
            client.invoke("add",_callback);
     }
    
     static class MyCallback implements IPendingServiceCallback {
         public void resultReceived(IPendingServiceCall call) {
             System.out.println ("result
Received"+call.getServiceMethodName()+":"+call.getServiceName()+":"+call.getStatus()+":"+call.getResult());
         }
     }

 }

        

-- 
View this message in context: 
http://www.nabble.com/Java-client-interaction-with-Red5-server-tf3962655.html#a11245805
Sent from the Red5 - English mailing list archive at Nabble.com.


_______________________________________________
Red5 mailing list
[email protected]
http://osflash.org/mailman/listinfo/red5_osflash.org

Reply via email to