Search code examples
javamultithreadingred5

How to make thread in Red5?


I want to make a thread in red5 application? this thread will send data to client using sharedObject. Actually, I made a thread at general java application, but it wasn't work when I implemented it in red5 app. I'll appreciate the details, thanks in advance

this is my latest class:

class XThread extends Thread{
    XThread() {
    }
    XThread(String threadName){
        super(threadName);
        //System.out.println(this);
        start();
    }
    public void run(){
        while(true){            
            try {
                new UserOnline().run();
                Thread.sleep(8000);
                //System.out.println();
            } catch (Exception e) {         
                e.printStackTrace();
            }
        }
        //System.out.println(Thread.currentThread().getName());
    }
}

Solution

  • I guess why nobody answer this question. It's because Red5 api already has ApplicationAdapter that supporting IScheduleService to make scheduling job.

    Sorry stackoverflow, I just know a day ago.