Friday, May 01, 2009

Red5 and Java RTMPClient Problems

One more day passed and I am still struggling with Java RTMPClient to make it properly work with Red5. Started with red5 v0.6.2 and checked up to v0.8 but the problem is still there. I did not get success passing parameters to connect method.
The connect method is working without any parameters, i.e. connect(String server, int port, String application, IPendingServiceCallback connectCallback) and what I need is connect(String server, int port, Map connectionParams, IPendingServiceCallback connectCallback). When i am passing a HashMap to connect method, i am not able to get any parameters on the server side. Inside connect method in Red5, the params[] is of size 0. It's really frustating. It means, i am not able to validate the user before connecting it to Red5. It means, anonymous connection can be made to application and then reject or accept them later accordingly.
Ok, so i thought, i will do this way, but here my problem does not ends. What i am doing now is accepting connection to each user and in callback function, i am sending user credentials from Java client and if those credentials are not correct, i am rejecting this client.
Now once the client is accepted and i have to invoke couple of methods on server. The problem starts again. Invoke() function does not work as expected. It's working only from within the connectCallback block.

public void resultReceived( IPendingServiceCall call ) {
// If you call invoke() from here. it works.
}

It means, I call invoke methods from within this block and not from outside of this block. Then I Googled and found many people facing the same problem. The only working solution was http://www.nabble.com/Re%3A-RTMPClient.invoke%28%29-p15075904.html

It's bad to see not much progress on Java RTMPClient in Red5 from so long. I tested with different versions and upto latest one and everywhere it's same. I am still doing workarounds to let RTMPClient working in my application. :(

1 comments:

youmania said...

nice information subil. your blog is very attractive & informative too. keep it up.
are you intersted in link exchange?

Daily Technology Tips

Catch me at Mashable

PayPal

Sign up for PayPal and start accepting credit card payments instantly.

Blog Explosion


Bloglines

Blogrush


BlogsByCategory.com