[Asterisk-java-users] Lot of timeouts when sending actions repetedly
Brought to you by:
srt
From: Mattias M. <ma...@wx...> - 2006-01-25 17:03:11
|
Hi all! =20 I am currently using this simple class to monitor the queue. One instance of this class is created once every one second (and hopefully deleted after reaching end). =20 I am actually quite new at Java and thread programming so I realize that there must be some better way to do this, but I hope this is sufficient for the time being. =20 The problem (if it is a problem) I am experiencing at the moment is that I receive one timeout every second, but it seems like I get all the events generated by this action. =20 My question is this: Do I actually lose any information as I get these timeouts or are there any other reasons for receiving them? =20 Never mind the horrors of my code. I just created this to get around the deadlock I experienced when trying to send an action from the event dispatching thread. =3D) =20 Thanks in advance! =20 // Mattias Malmquist =20 =20 =20 public class QueueStatusChecker extends Thread { ManagerConnection manager; EventGeneratingAction action; =20 public QueueStatusChecker(ManagerConnection manager, ManagerAction action) { this.manager =3D manager; this.action =3D (EventGeneratingAction)action; } public void run() { try { =20 manager.sendEventGeneratingAction(action, 5000); } catch (Exception e) { =20 if(e.getClass().getSimpleName().equals("EventTimeoutException")) { =20 System.out.println("Timeout"); } } } } |