Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to invoke client methods from serverside #83

Open
rajdeeprath opened this issue Jul 7, 2017 · 0 comments
Open

Unable to invoke client methods from serverside #83

rajdeeprath opened this issue Jul 7, 2017 · 0 comments

Comments

@rajdeeprath
Copy link

rajdeeprath commented Jul 7, 2017

Red5 / Red5pro provides a mechanism to invoke client side methods from server code using the IServiceCapableConnection interface.

Example Red5 / Red5pro Server side Snippet :

private void serverToClient(IConnection conn, String method){
	
	try{
		IServiceCapableConnection invokeConn = (IServiceCapableConnection) conn;
		invokeConn.invoke(method);
	}catch(Exception e){
		log.error("An error occurred {}", e.getMessage());
	}
}

OR

private void serverToClient2(IConnection conn, String method, Object[] args){
	
	try{
		IServiceCapableConnection invokeConn = (IServiceCapableConnection) conn;
		invokeConn.invoke(method, args);
	}catch(Exception e){
		log.error("An error occurred {}", e.getMessage());
	}
}

This works as expected on an RTMP client (Flash) but when trying to use it with Red5pro Android SDK, I am running into an error even though the message is right there in that class.:

Error Details

/r5pro: Received invoke: clientMethod1 - void with 0 params

D/R5Stream: Received callback from JNI - clientMethod1 | 

D/R5Stream: Failed to call method with error: clientMethod1 [class java.lang.String

Client TestSource Code:

https://github.com/rajdeeprath/streaming-android/blob/feature/connection-messaging/app/src/main/java/red5pro/org/testandroidproject/tests/PublishServerMessagingTest/PublishServerMessagingTest.java

Flash Client TestSource Code:

https://github.com/rajdeeprath/red5-development-series/blob/master/code-examples/client-side/connection-messaging-demo/src/Main.mxml

Red5Pro server side Code:

https://github.com/rajdeeprath/red5-development-series/tree/master/code-examples/server-side/red5-connection-examples/connection-messaging-demo

The application should be built using maven and deployed on Red5pro server before you run the client test from the project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant