[Red5] RTMPClient for help

Yuliang-Yang zjuyyl at gmail.com
Tue Jun 3 02:02:28 PDT 2008


still have'nt solved
connectParams Map seems can't take any other custom key,

my boss asks me to use 443 :(..

2008/6/3, Daniel Rossi <electroteque at gmail.com>:
>
> connectParams is just an object array of your connection params. The rest
> is done internally. So it would be {"something","something else"} correct ?
> Why are you using 443 as the port. This class does not support rtmps yet.
>  On 03/06/2008, at 12:43 PM, Yuliang-Yang wrote:
>
>  it seems no way to direct pass to that,,I think need use
> conn.getConnectParams();
> thanks all.
>
>
> 2008/6/3, Yuliang-Yang <zjuyyl at gmail.com>:
>>
>>
>> I look the red5 source code and ask google,,but still have no idea how to
>> pass params
>>
>> Yes I can pass some red5 params use connectionParams
>>   params.put("app","test");
>>   params.put("flashVer", "WIN 9,0,16,0");
>>   params.put("swfUrl","http://localhost/test.swf");
>>   params.put("tcUrl", "rtmp://localhost/oflaDemo");
>>   params.put("fpad", false);
>>   params.put("audioCodecs",(double)615);
>>   params.put("videoCodecs",(double)76);
>>   params.put("pageUrl","http://localhost/test.html");
>>   params.put("objectEncoding",(double)0);
>>
>> connect("10.10.1.1", 443, params);
>>
>> but how to pass the params that will pass to
>>  public boolean appConnect(IConnection conn, Object[] params) {
>>   return true;
>>  }
>>
>>
>>
>> 2008/6/2, Daniel Rossi <electroteque at gmail.com>:
>>>
>>> There is a connect method to send params with see here
>>>
>>>  connect(String server, int port, Map<String, Object> connectionParams)
>>>
>>>
>>>  On 02/06/2008, at 7:09 PM, Atulesh MORE wrote:
>>>
>>> just create ur method in oflademo's apConnect file and call it from rtmp
>>> java client
>>>
>>>
>>>
>>>
>>> package org.red5.server.webapp.echo;
>>>
>>> import java.util.ArrayList;
>>> import java.util.HashMap;
>>> import java.util.List;
>>> import java.util.Map;
>>> import java.util.Random;
>>>
>>> import org.apache.commons.lang.RandomStringUtils;
>>> import org.red5.io.utils.ObjectMap;
>>> import org.red5.server.api.IConnection;
>>> import org.red5.server.api.Red5;
>>> 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 TestClient
>>> {
>>>   public static void main(String[] args)
>>>   {
>>>
>>>      List<String> userNames = new ArrayList<String>();
>>>      userNames.add("sri");
>>>      userNames.add("something");
>>>      for (String name : userNames)
>>>      {
>>>          try
>>>          {
>>>             Thread t = new Thread(new MyCallback("sri"));
>>>             Thread.sleep(3000);
>>>             t.start();
>>>          }
>>>          catch (InterruptedException e)
>>>          {
>>>             e.printStackTrace();
>>>          }
>>>      }
>>>   }//End Of main
>>>   static class MyCallback implements Runnable
>>>   {
>>>
>>>      RTMPClient client = new RTMPClient();
>>>
>>>      List<String> actions = new ArrayList<String>();
>>>
>>>      protected static final ThreadLocal<IConnection> currentSession =
>>>      new ThreadLocal<IConnection>();
>>>
>>>      static boolean created = false;
>>>
>>>      IConnection conn = null;
>>>
>>>
>>>      public MyCallback(String name)
>>>      {
>>>        init(name);
>>>      }
>>>
>>>      public void run()
>>>      {
>>>
>>>          try
>>>          {
>>>              Red5.setConnectionLocal(conn);
>>>              while (true)
>>>              {
>>>
>>>
>>>                 System.out.println("conn is........"+conn);
>>>
>>>  //Now it will invoke  addNumber method in appConnect.java and send it
>>> two no 3 and 4 and got their addition
>>>  client.invoke("addNumber",new Object[]{3,4}, new
>>> IPendingServiceCallback() {
>>>                  public void
>>>                  resultReceived(IPendingServiceCall call)
>>>                  {
>>>                   System.err.println("Result Received: " +
>>> call.getResult());
>>>                  }
>>>                  });
>>>
>>>
>>>                  Thread.sleep(5000);
>>>                       }//end of while
>>>          }
>>>          catch (InterruptedException e)
>>>          {
>>>               e.printStackTrace();
>>>          }
>>>      }
>>>
>>>      private void init(String login)
>>>      {
>>>      ObjectMap<String, Object> params = new ObjectMap<String,
>>>      Object>();
>>>
>>>      params.put("app", "elcMagnets/");
>>>      params.put("tcUrl", "rtmp://10.0.0.6/elcMagnets/");
>>>
>>>      Map<String, Object> tparams = new HashMap<String, Object>();
>>>      tparams.put("password", "password");
>>>      tparams.put("username", login);
>>>      Object[] obj = new Object[] { tparams };
>>>       client.connect("10.0.0.6", 1935, params,
>>>      new IPendingServiceCallback()
>>>      {
>>>          public void resultReceived(IPendingServiceCall call)
>>>          {
>>>              System.err.println("Second result Received: "+
>>> call.getResult() + "::" + Red5.getConnectionLocal().hashCode());
>>>              conn = Red5.getConnectionLocal();
>>>
>>>          }
>>>      });
>>>      }
>>>      }
>>>
>>> }
>>>                                Regards--                  Atulesh
>>>
>>> ____________________________________________________________________________________________________________________
>>> On Mon, Jun 2, 2008 at 1:51 AM, Yuliang-Yang <zjuyyl at gmail.com> wrote:
>>>
>>>>
>>>> can any one give me any adivice?
>>>> 2008/5/29, Yuliang-Yang <zjuyyl at gmail.com>:
>>>>>
>>>>>  javaclient:
>>>>> private RTMPClient rtmp = new RTMPClient();
>>>>>
>>>>>    rtmp.connect("172.16.2.83", 443, "dfwlogin");
>>>>>
>>>>>
>>>>> server
>>>>>
>>>>>  public boolean connect(IConnection conn, IScope scope, Object[]
>>>>> params) {
>>>>>
>>>>>   log.debug("connect...");
>>>>>   if (!super.connect(conn, scope, params)) {
>>>>>    return false;
>>>>>   }
>>>>>   return true;
>>>>>
>>>>>  }
>>>>> At a flash client I can use
>>>>> nc.connect("this is my first param");
>>>>> to pass the params,
>>>>> My question is How can  I pass the params from javaClient,,
>>>>>
>>>>> --
>>>>> best regards,
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> best regards,
>>>> _______________________________________________
>>>> 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
>>>
>>>
>>>
>>> _______________________________________________
>>> Red5 mailing list
>>> Red5 at osflash.org
>>> http://osflash.org/mailman/listinfo/red5_osflash.org
>>>
>>>
>>
>>
>> --
>> best regards,
>
>
>
>
> --
> best regards, _______________________________________________
> 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
>
>


-- 
best regards,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://osflash.org/pipermail/red5_osflash.org/attachments/20080603/b75e6491/attachment.html 


More information about the Red5 mailing list