I have a working red5 application and I use MultiThreadedApplicationAdapter, but multithreading does not work. Here is an example that I want to do this so that multiple clients call test () and return without blocking other clients. However, it happened that the second client must wait for the completion of the first client, and then run test (). Any idea how to make this work? Thanks.
public class Application extends MultiThreadedApplicationAdapter { public void test() { System.out.println("test "+System.currentTimeMillis()); try { Thread.sleep(5000); } catch (InterruptedException e) { e.printStackTrace(); } } }
Client-side code is as follows:
conn.addEventListener(NetStatusEvent.NET_STATUS, onNetStatus); conn.connect(server); conn.call("test",null);
source share