Timers

ok, call me dumb or whatever but i just don't understand timers.
how would i make a timer to fire every second and add 1 to an integer?
I've tryed to understand it but there are swing timers and regular timers? and i keep getting confused and all the tuts i keep finding are just so confusing. I'm brand new to java so try not to use too many fancy things if you feel like helping.
oh, and sorry if i'm in the wrong Forum

Perhaps a working example would help.
import java.util.*;
public class TimerExample {
     public static void main(String[] args) {
          Timer timer = new Timer("Test Timer");
          timer.schedule(new TimerTask() {
               private int counter = 0;
               public void run() {
                    counter++;
                    System.out.println(new Date() + ": Counter=" + counter);
                    if (counter >= 10) {
                         System.out.println("Finished.");
                         System.exit(0);
          }, 0, 1000);
}Prints
Thu Oct 13 22:18:28 BST 2005: Counter=1
Thu Oct 13 22:18:29 BST 2005: Counter=2
Thu Oct 13 22:18:30 BST 2005: Counter=3
Thu Oct 13 22:18:31 BST 2005: Counter=4
Thu Oct 13 22:18:32 BST 2005: Counter=5
Thu Oct 13 22:18:33 BST 2005: Counter=6
Thu Oct 13 22:18:34 BST 2005: Counter=7
Thu Oct 13 22:18:35 BST 2005: Counter=8
Thu Oct 13 22:18:36 BST 2005: Counter=9
Thu Oct 13 22:18:37 BST 2005: Counter=10
Finished.BTW: If you are New to Java, in future, I suggest you post to the "New To Java" forum.
This doesn't mean post this question again as this will only annoy people.

Similar Messages

  • Problem with timers in a udp state pattern

    Hi.
    As a project on my school, i have created a bomberman game, that supports up to 4 players on a network. And it works fine, when there is no network timers involved, that means no packet loss handling.
    The network part of the game, is build up by UDP, to make the application support multicast. The game session flow, is build up by states which are designed like an extended 2 phase commit pattern.
    That means, the server sends Gameinfo to the clients. Then all the cliens replies with an ACK.
    The server then sends ExecuteGameinfo. Then the clients replies with an ACK.
    The server sends/requests playerinfo, and the clients reply with player info. (the server uses the player info to create gameinfo).
    These 3 states, continues to go on, as long as the game is running. And without timers, it is working great.
    But what if a packet is lost? (on a LAN, packetloss is very rare, but for the sake of my project�s issue, custom made reliability in UDP, I have to face the problem). Then the server would just hang, and wait for the client reply.
    To avoid that, i want to use a timer. If the server havent got any reply for like a 100 ms., the server should resend the package.
    And now to the actual problem :)
    Ive tried using java.util.Timer, and javax.swing.Timer. But both timers does not work in my case. Its like:
    Server starts timer.
    Server sends Gameinfo.
    100 ms passes.
    Server resends Gameinfo.
    Server restarts timer.
    100 ms passes.
    (this goes on for 5 times, and then the client is kicked)
    Server receives ACK.
    Server receives ACK.
    Server receives ACK.
    Server receives ACK.
    Server receives ACK.
    On the client side it looks like this:
    Recieves Gameinfo, replies with ACK
    Recieves Gameinfo, replies with ACK
    x 5
    So its like the server is to concentrated on that timer (even though it runs as a thread), so i doesent notice the incoming packets, that eventually stacks up, and is handled after the timer tasks are done.
    And this is exactly the problem that is described in the Timer api: " Timer tasks should complete quickly. If a timer task takes excessive time to complete, it "hogs" the timer's task execution thread. This can, in turn, delay the execution of subsequent tasks, which may "bunch up" and execute in rapid succession when (and if) the offending task finally completes."
    Ive tried using a homemade timer, with a Thread.sleep(), it is a bit better, but the problem is the same. 1 out of 20 incoming packets, is "ignored" by the server.
    I really hope any of you can help.
    I havent included any code, it would be to much code. But if you are interested in looking at something i can easily paste it.
    Thank you very much for your time :)
    Regards.

    Don't use a Timer, use DatagramSocket.setSoTimeout(). Then your receives will only block for that amount of time, throwing SocketTimeoutException if no datagram arrives.

  • Is there a way to use 2 timers independently?

    What I've done so far..
    I have 2 timers; each started in the createGUI method of 2 windows. So, Timer1 is started in Window1 and Timer2 is started in Window2.
    Window 1
    public void createMealsGUI()
            Container wMeals = getContentPane();
            wMeals.setLayout(new BorderLayout());
            timer = new Timer(10, this);
            timer.start();}Window 2
    private void createOpenFileGUI()
             Container wOpenFile = getContentPane();
             wOpenFile.setLayout(new BorderLayout() );
             wOpenFile.setPreferredSize(new Dimension(400,400));
             timer2 = new Timer(10, this);
            timer2.start();}I have 2 counters in the ActionEvent method that I would like to use with the timers.
    public void actionPerformed(ActionEvent event)
              timercounter=timercounter+1;
              timerCounterOpenFile=timerCounterOpenFile+1;}Both counters will run if either timer is started because both timers are using the same actionListener but I'm unsure how to go about making it so each timer will only affect one of the couter variables.
    I tried using timer(10, new ActionListener()) to try and create a new ActionEvent but it doesn't allow that to be saved. Not sure what I'm doing wrong.
    I'm guessing I need another ActionEvent for one of the timers but I don't know how to do this. The only way I know currently is 'new actionListener this'.
    Even better would be to use an 'if statement' for event.getSource() == timer, but when I try that it doesn't work like it would a button etc.
    Edited by: FillytheBish on May 11, 2010 7:03 AM
    Edited by: FillytheBish on May 11, 2010 7:07 AM

    Lots of options
    1. Make seperate classes exending actionLister and then use something like
    new Timer(10, myTimerActionClass());2. Just create actionlistener in timer declartion. This is probably the easiest and cleanest method. ie
    new Timer(10, new ActionListerner(){
       public void actionPerformed(ActionEvent event) {
          //do stuff
    });

  • Cursor changes to "Busy" when timers expires in Form

    Forms 10.1.2.0.2
    I created a Form with a multinline block to implement a blinking effect on certain rows depending on certain conditions
    whilst using a repeating timer.
    The screen is working fine so far but I am facing the problem that the cursor automatically changes its status from
    normal to busy for a moment and then back from busy to normal when the timers expires.
    In addition, the status bar on the console (which is the lower right working status bar) displays a "working"
    condiition when the timers expires (scrolling from left to right each time the timer expires).
    This leads to annoying visible effects as not only my rows are blinking fine but also the cursor does -.-
    I removed the Synchronze; Built-In from the WHEN-TIMER-EXPIRED and also replaced any data processing within
    the Trigger by a Null; Statement but the cursor keeps on changing its Form automatically.
    I also tried to set the Cursor style to default within this Trigger but the cursor keeps on changing its Form.
    Is there any way to suppress this behaviour ?

    Hi,
    Do you have any security programs installed on your computer? If so, temperarily turn off them to check if this issue persists.
    We can also try to run Word in safe mode to test if the issue is caused to a problematic add-in. To do this, press Windows key + R, type
    Winword.exe /safe in the Run dialog and press Enter. 
    In addition, did you installed any printer drivers? If so, some bad printer drivers may cause such issue. Please make sure you have installed the latest printer driver form the official website. If possible, we can try to uninstall the printer drivers
    to check if the issue persists.
    Regards,
    Steve Fan
    TechNet Community Support

  • ImageIO, Timers, Transparency and a Rant

    Hi all,
    <BEGIN RANT>
    After years of writing games and programming next-gen consoles, I foolishly decided to write a few online java games. Like many, I chose Java because it is very similar to c++ and accessible cross-platform on web pages by the masses with no extra downloads required (btw, I'm not using j3d for this reason). Instead I've found it to be nothing but a burden.
    Today's gripes are below. If I sound like I'm having a rant, well, adter fighting it all this week, I am!. Any help/suggestions/discussions are most appreciated. I'm currently using j2sdk 1.4.1_02.
    1) why can't I enable hardware accleration (currently transparency sucks on the framerate) without requiring permissions? What exactly am I going to do with it to make it a security risk?
    2) Why doesn't Java (without j3d or any other extensions) support the high-resolution timer? Such a basic issue that has been plaguing these forums for years. It seems i can't even do a work around as using JNI requires permissions and an external module on the users machine so I can't do this from an APPLET without signing and installing something. Sure, I could just about use 15ms on w2k and make win98 users suffer 20fps with the 50ms res timer. I tried (and succeeded) using my own timers but that means I can't sleep (as sleep>0 will sleep for at least the timer resolution) so my cpu usage is on 99%. And it destroyed my win98 machine :-)
    3) Has anyone had problems with ImageIO.read in an applet? I find that occasionally when reading an image from my web server, it reads it twice (I guess it found an error and re-requests it) and corrupts the image. At first I thought it was my php corrupting the image, but it does it on direct accesses as well. Toolkit.createImage does not seem to have this problem (but then I have to wait for it to load (currently i construct a cursor with the image which seems to sort it) and then paste it to BufferedImage rather than the inaccessible image type returned by toolkit). Toolkit does however have the advantage that I can use extensionless image files and prevent caching though which ImageIO.read seems unable to handle (it usually loses the palette of gifs etc without the extension hint). My web server is apache 2.0.45 on Win2K btw.
    These issues concern APPLETS. If i wanted to write an application, I would use C++ and OpenGL with very little extra work required for each specific platform (I'd only support PC, Mac and x86 based linux anyway). The point is that i want it embedded on a web page, and I don't want the user to have to install anything other than the Java VM.
    What about the rest of you?
    What are your experiences with Java? Good? Bad?
    Do you guys think there is any future for it?
    Does Java 1.5 have anything to offer?
    IF it comes down to it, and I NEED to sign my code and INSTALL code then I will just abandon Java altogether and just stick to windoze users (It will take a fraction of the development time and be far less painful for me to use ActiveX or .net).
    Oh, and if you're just going to reply and say something like "I think Java's the bestest thing ever, it's so much better and cooler than C++ and all my friends think so too. Cos my teacher says so" then don't waste my time.
    If you have games experience and know what you're on about then I'd love to hear your views.
    <END RANT>
    Cheers
    -Simon

    Hi Paul,
    Thanks for your views.
    Badly because it provides the security protections it
    says it does?No, I mostly appreciate the security but some things seem a little too secure. For example, I want to use hardware acceleration for my translucencies but Java won't let me....
    You can always ask users to change the permissions
    your applet runs under, I guess, assuming the browser
    support it. But at that point, why not just write
    your game in C++ and tell people to download it and
    run it normally?
    If you're trying to write a Quake clone in java and
    distribute it as an applet...don't bother.The point is that I don't want to do this. I want ppl to have to visit the web site to play the game without having to grant permissions or install anything or agree to run signed code (not just for advertising purposes but also as some of the games will be multiplayer). This is why I'm using Java and not activeX or .net.
    I am perfectly capable of writing any genre of game to be cross platform in C++ (if I use OpenGL then I only need a thin platform-specific wrapper and I just compile it for my required targets - PC, Mac, x86 Linux), and I really don't see the point in attempting it as a Java application. The games I'm currently doing for my website in Java are simple 2d games suitable as applets. The main problem I'm having is that I need to sleep to free up the cpu, but the low-res timer resolution means that I can only run at 20fps on win98 when sleeping. Yes it runs ok, but by no means as smooth as I'd like.
    I think java may be used in action gaming once it's
    embedded into an environment that really supports it
    (e.g., as a well-supported programming environment for
    PlayStation 2) (and somehow I doubt that OpenGL
    bindings for java will work as a gaming environment,
    although that's just a hunch), and it's fine for
    non-action games.Yes it can do the job, but the fact is that Java is and always will be slower than code compiled directly for the target CPU so this means my entire audience need to have higher spec machines to run it than I'd like. I would not write anything that is too CPU intensive in Java as there are also still a lot of low spec machines out there running win98 which I (unlike most ppl on these forums) am still willing to support.
    Cheers
    -Si

  • How can I change power mamangement idle timers to less than 15 minutes?

    Can someone please take a crack at this? It's a little confusing that power manager allows the display to be turned off after only 1 min of idle yet won't allow the brightness to be lowered until at least 15 minutes. I would like the brightness to be lowered (maybe 5 minutes) and then turn the display off after 15 min. Why can't all idle timers be set by the minute instead of those 15/30/etc min intervals?

    I have the latest version 2.5. Still some settings, like lowering brightness, have discrete idle times that start at 15 minutes. It might be a a vista power management issue and in that case I still don't understand why some settingshave 15 minute interval options and some can be set to any number of minutes.
    really i wouldn't mind being able to lower the brightness at even 1 minute idle when on battery power. 
    Message Edited by wonderbread57 on 07-22-2009 07:16 PM

  • Using cDAQ timers to repeat a hardware-timed finite-sample pulse train clock

    Hi all,
    As part of a complex project, I must implement an acquisition hardware interface for a linear motion sensor using the Synchronous Serial Interface (SSI) output common in industrial motion control. (I have a fair bit of experience in digital electronics, but I'm new to hardware timer-synchronized digital I/O in LabVIEW.)
    To do this, I need to create a hardware-timed bursted pulse train TTL clock signal. Each burst consists of 25 high-low transitions with a full-cycle period of 2.67 microseconds (375kHz). The output must then be held high until the next burst, which occur at 1ms intervals.
    Using cDAQ timers and a NI 9401 (based on the example at http://www.ni.com/example/30256/en/), I've been able to create the pulse train burst as described (see attached VI image). Next I need to configure another timer to trigger this burst to repeat at 1ms intervals.
    Does anyone have any pointers about the best way to accomplish the hardware timing for repetition of the pulse train?
    Any suggestions of alternative strategies or observations as to the ways my noobish code is stupid or inefficient are welcome as well!
    Thanks!
    Solved!
    Go to Solution.
    Attachments:
    Hardware Timed Pulse Train Clock.jpg ‏102 KB

    Hey Ryan, 
    A picture of the behavior you are seeing would be helpful. The NI 9411 should only be reading 50 bits every 1 ms.  
    It may not be possible to read 25 bits (do you mean 50 bits? 25 high 25 low) and push it to a queue without encountering an overflow error. If you take a look at the above code the digital input will receive 50 sample clocks every 1 ms. This is equivalent to acquiring 50 points every 1 ms which is an acquisition speed of 50 samples/1 ms=50 kHz. The read loop must keep up with the 50 kHz rate otherwise the buffer will overflow. In the above example I’ve set the read to pull 5000 samples (x) with the assumption that the loop will take less than or equal to .1 seconds (y). This yields a software acquisition speed of 50 kHz (5000 samples/100 ms). If the loop speed is faster than 100ms then the 10 seconds timeout on the DAQmx read will allow for the read to block so the FIFO may be filled.
    The options available for question 2 are below. They may be used separately or in conjunction.
    Move the DAQmx Read for the NI 9411 to its own independent while loop, set the DAQmx Read to acquire 50 samples, do not graph the data, and pass the data to a Queue for processing in a consumer loop. This will increase the loop speed which may allow you to keep up with the 50 kHz acquisition speed. This may not work because the loop speed will need to be 1 ms or less.
    Increase the value of the Samples per Channel control that goes into the DAQmx Timing VI. This will increase the DAQmx Software Buffer size. This buys time until you receive an overflow error because the DAQmx Software Buffer is being filled faster than samples are removed.
    Read in 5000 sample chunks (producer loop), push this to the queue, and perform the analysis in 50 bit chunks (consumer loop). The additional queue created should allow for the acquisition loop to keep up.
    Regards,
    Izzy O.
    Product Support Engineer
    ni.com/support

  • Trying to understand what are the parameter/output From debug SNMP timers

    Hi All
    I am trying to understand what are the parameter/output
    From the debug SNMP timers
    Output SNMP timers :
    *Dec 31 11:56:27: SNMP: HC Timer 632DDE28 fired
    *Dec 31 11:56:27: SNMP: HC Timer 632DDE28 rearmed, delay = 5000
    *Dec 31 11:56:32: SNMP: HC Timer 632DDE28 fired
    *Dec 31 11:56:32: SNMP: HC Timer 632DDE28 rearmed, delay = 5000
    *Dec 31 11:56:37: SNMP: HC Timer 632DDE28 fired
    *Dec 31 11:56:37: SNMP: HC Timer 632DDE28 rearmed, delay = 5000
    *Dec 31 11:56:38: SNMP: HC Timer 70B54A70 fired
    *Dec 31 11:56:38: SNMP: HC Timer 70B54A70 rearmed, delay = 20000
    70B54A70 , 632DDE28 „² what this number means.
    5000 , 20000 „² why I have different delay time ( does it means that I have delay for SNMP request )

    The debug messages you are seeing are related to High-Capacity (HC) timers, which manage updates to 64-bit (HC) snmp counters as defined in RFC2233.
    The "fired" and "rearmed" messages indicate when each of these timers
    updates ("fired") the HC snmp counters, and when they should fire next
    (the "rearmed" messages). Higher speed interfaces require updates more often than lower speed interfaces, so you see two examples of that in your debug messages - 5000 ms updates vs 20000 ms update.
    The numbers that are in the messages (i.e. 632DDE28 ) are internal references to the timer that has fired.
    These messages do not indicate any delay in SNMP message processing, but normal SNMP operation of HC counters.

  • Canceling timers after server restart

    hi,
    i create a couple of timers. while the application server is up i can cancel them by getting the TimerService object of the bean it's associated with, calling getTimers() and cancelling the Timer objects returned from it.
    if i restart the server (let's say it crashed), the timers created in the previous session are back to run - they are persistent by definition. but now i can't cancel them anymore: same getTimers() returns an empty Collection. i think this happens because the old timers from the previous session were not rebound to the new ejbcontext, or something like this.
    my question is: how can i cancel timers, that were re-invoked after server restart.
    thank you.
    Message was edited by:
    cyclid

    Below are my tests that show canceling of timers working as expected:
    Session bean methods:
    public void createTimers()
    {       System.out.println("### CREATE - a single-action timer that expires in 4s");
    ctx.getTimerService().createTimer(4000, "single-action timer that expires in 4s");
    System.out.println("### CREATE - an interval timer that expires in every 2s");
    ctx.getTimerService().createTimer(2000, 2000, "interval timer that expires in every 2s");
    public void cancelAllTimers() {   
         System.out.println("### CANCEL - timers:");     
         for (java.util.Iterator iter = ctx.getTimerService().getTimers().iterator(); iter.hasNext();) {
              Timer timer = (Timer) iter.next();
              System.out.println(" canceling ... " + timer.getInfo());
              timer.cancel();
    public void logCurrentTime() {
         System.out.println("### CURRENT TIME - " + java.util.Calendar.getInstance().getTime());
    public void ejbTimeout(Timer timer)
    {     System.out.println("### EJB TIMEOUT - " + timer.getInfo());       
    Java Client test:
    ejb.cancelAllTimers();
    Thread.sleep(4000);
    ejb.logCurrentTime();
    ejb.createTimers();
    Thread.sleep(8000);
    ejb.cancelAllTimers();
    ejb.logCurrentTime();
    Thread.sleep(8000);
    ejb.logCurrentTime();
    Logs:
    1. Shutdown servers while there is an interval timer
    The log shows the interval timer came back and then was cancel after server restart
    07/02/06 13:46:23 ### CANCEL - timers:
    07/02/06 13:46:27 ### CURRENT TIME - Tue Feb 06 13:46:27 EST 2007
    07/02/06 13:46:27 ### CREATE - a single-action timer that expires in 4s
    07/02/06 13:46:27 ### CREATE - an interval timer that expires in every 2s
    07/02/06 13:46:29 ### EJB TIMEOUT - interval timer that expires in every 2s
    07/02/06 13:46:31 ### EJB TIMEOUT - single-action timer that expires in 4s
    07/02/06 13:46:31 ### EJB TIMEOUT - interval timer that expires in every 2s
    07/02/06 13:46:32 Shutting down OC4J...
    C:\oc4j\10131_061009\j2ee\home>java -jar oc4j.jar
    07/02/06 13:48:12 Oracle Containers for J2EE 10g (10.1.3.1.0) initialized
    07/02/06 13:48:13 ### EJB TIMEOUT - interval timer that expires in every 2s
    07/02/06 13:48:15 ### EJB TIMEOUT - interval timer that expires in every 2s
    07/02/06 13:48:17 ### EJB TIMEOUT - interval timer that expires in every 2s
    07/02/06 13:48:18 ### CANCEL - timers:
    07/02/06 13:48:18 canceling ... interval timer that expires in every 2s
    07/02/06 13:48:22 ### CURRENT TIME - Tue Feb 06 13:48:22 EST 2007
    2. Cancel timers right after they were created
    07/02/06 13:50:11 ### CANCEL - timers:
    07/02/06 13:50:15 ### CURRENT TIME - Tue Feb 06 13:50:15 EST 2007
    07/02/06 13:50:15 ### CREATE - a single-action timer that expires in 4s
    07/02/06 13:50:15 ### CREATE - an interval timer that expires in every 2s
    07/02/06 13:50:17 ### EJB TIMEOUT - interval timer that expires in every 2s
    07/02/06 13:50:19 ### EJB TIMEOUT - single-action timer that expires in 4s
    07/02/06 13:50:19 ### EJB TIMEOUT - interval timer that expires in every 2s
    07/02/06 13:50:21 ### EJB TIMEOUT - interval timer that expires in every 2s
    07/02/06 13:50:23 ### EJB TIMEOUT - interval timer that expires in every 2s
    07/02/06 13:50:23 ### CANCEL - timers:
    07/02/06 13:50:23 canceling ... interval timer that expires in every 2s
    07/02/06 13:50:23 ### CURRENT TIME - Tue Feb 06 13:50:23 EST 2007
    07/02/06 13:50:31 ### CURRENT TIME - Tue Feb 06 13:50:31 EST 2007

  • Is this program good for first timers or college students?

    Is this program good for first timers or college students?

    After Effects is a program that can do a simple transition between two still images or produce any composite you have seen in a feature film. The only thing After Effects cannot do is create, edit, and animate 3D models like robots or space ships. You can, however, in concert with a 3D app do anything you have ever seen on the screen and, if you are really creative and talented, probably do something we have not seen yet. You can achieve a successful first project by following these 3 videos: Basic Workflow
    It may take years of experimenting and research to create something we have not seen yet. Starting to learn to use After Effects is like having the key to the Snap On truck and access to all the tools. You just have to gain enough knowledge to use them all.

  • Behaviour of AP Timers

    Hi there,
    I am currently fumbling around a little bit with the AP timers on our WLCs in order to improve convergence.
    For this I activated the fast heartbeat for local mode APs.
    The documentation states the normal heartbeat timer must be at least 3 times larger than the fast heartbeat timer.
    Also for the AP to switch the WLC it takes to heartbeats and after those fail 7 heartbeats every second.
    That would be 17 seconds with a fast heartbeat timer of 5 seconds.
    I am a little bit confused regarding the relation of the heartbeat timer to the fast heartbeat timer.
    As I understood the local mode APs only rely on this fast heartbeat timer and don't care of the normal one anymore.
    Why should I be concerned if the normal heartbeat is not 3 times larger?
    I then decided to just put it to the test and see how fast the AP converge. It took the AP about 21 seconds. I expected this variance of 4 seconds to be the preceding heartbeat, during which I denied the AP access to the primary controller.
    When allowing access of the AP to the primary controller again it took about 114 seconds to switch back.
    I suspect this is due to the AP Primary Discovery Timeout with a default of 120 seconds. Is this assumption correct?
    I cannot explain otherwise as heartbeat messages are only sent to the current associated WLC.
    I also noticed when configuring them over the CLI there is a new timer:
    config advanced timers ap-primed-join-timeout
    According to the CLI description:
    Configures AP Primed Discovery Timeout value between 120 and 43200 seconds(12 hours).
    Can someone elaborate on this command please?

    Instead of posting a new discussion I will use my old thread.
    The issue above is mostly solved my testing around although I still havent found out what the config advanced timers ap-primed-join-timeout does as well as the 1:3 relation between heartbeat and fast-heartbeat. If anyone knows I would be grateful for the information.
    Before I come to my actual question here some background information just for the sake of completeness:
    During the event of a controller outage the AP sends 5 retransmission packets by default in a 3 second interval when using the normal heartbeat.
    AP Debug output:
    *Feb  8 11:40:01.449: %CAPWAP-3-EVENTLOG: Sending packet to AC*Feb  8 11:40:01.468: %CAPWAP-3-EVENTLOG: Queue Empty.*Feb  8 11:40:01.468: %CAPWAP-3-EVENTLOG: Wtp Event Response from *Feb  8 11:40:31.469: %CAPWAP-3-EVENTLOG: Echo Interval Expired.*Feb  8 11:40:31.469: %CAPWAP-3-EVENTLOG: Sending packet to AC*Feb  8 11:40:31.469: %CAPWAP-3-EVENTLOG: Echo Request sent to *Feb  8 11:40:34.470: %CAPWAP-3-EVENTLOG: Retransmission Count= 0 Max Re-Transmission Value=5*Feb  8 11:40:34.470: %CAPWAP-3-EVENTLOG: Sending packet to AC*Feb  8 11:40:37.471: %CAPWAP-3-EVENTLOG: Retransmission Count= 1 Max Re-Transmission Value=5*Feb  8 11:40:37.471: %CAPWAP-3-EVENTLOG: Sending packet to AC*Feb  8 11:40:40.472: %CAPWAP-3-EVENTLOG: Retransmission Count= 2 Max Re-Transmission Value=5*Feb  8 11:40:40.472: %CAPWAP-3-EVENTLOG: Sending packet to AC*Feb  8 11:40:43.473: %CAPWAP-3-EVENTLOG: Retransmission Count= 3 Max Re-Transmission Value=5*Feb  8 11:40:43.473: %CAPWAP-3-EVENTLOG: Sending packet to AC*Feb  8 11:40:46.474: %CAPWAP-3-EVENTLOG: Retransmission Count= 4 Max Re-Transmission Value=5*Feb  8 11:40:46.474: %CAPWAP-3-EVENTLOG: Sending packet to AC*Feb  8 11:40:49.475: %CAPWAP-3-EVENTLOG: Retransmission Count= 5 Max Re-Transmission Value=5*Feb  8 11:40:49.475: %CAPWAP-3-EVENTLOG: Max retransmission count exceeded going back to DISCOVER mode.*Feb  8 11:40:49.475: %CAPWAP-3-EVENTLOG: The function which Posted the message to send out of the box is wtpSendEchoReques and of Type=1
    If fast-heartbeat is configured the retransmission packet count goes down to 3 although the 3 second interval remains.
    AP Debug output:
    *Feb  8 11:55:51.081: %CAPWAP-3-EVENTLOG: HeartBeat request sent to *Feb  8 11:55:51.100: %CAPWAP-3-EVENTLOG: Queue Empty.*Feb  8 11:55:51.100: %CAPWAP-3-EVENTLOG: Wtp Event Response from *Feb  8 11:55:51.100: %CAPWAP-3-EVENTLOG: HeartBeat response from *Feb  8 11:55:56.083: %CAPWAP-3-EVENTLOG: Sending packet to AC*Feb  8 11:55:56.083: %CAPWAP-3-EVENTLOG: HeartBeat request sent to *Feb  8 11:55:59.084: %CAPWAP-3-EVENTLOG: Retransmission Count= 0 Max Re-Transmission Value=3*Feb  8 11:55:59.084: %CAPWAP-3-EVENTLOG: Sending packet to AC*Feb  8 11:56:01.085: %CAPWAP-3-EVENTLOG: HeartBeat request sent to *Feb  8 11:56:02.085: %CAPWAP-3-EVENTLOG: Retransmission Count= 1 Max Re-Transmission Value=3*Feb  8 11:56:02.085: %CAPWAP-3-EVENTLOG: Sending packet to AC*Feb  8 11:56:05.086: %CAPWAP-3-EVENTLOG: Retransmission Count= 2 Max Re-Transmission Value=3*Feb  8 11:56:05.086: %CAPWAP-3-EVENTLOG: Sending packet to AC*Feb  8 11:56:06.087: %CAPWAP-3-EVENTLOG: HeartBeat request sent to *Feb  8 11:56:08.087: %CAPWAP-3-EVENTLOG: Retransmission Count= 3 Max Re-Transmission Value=3*Feb  8 11:56:08.087: %CAPWAP-3-EVENTLOG: Max retransmission count exceeded going back to DISCOVER mode.*Feb  8 11:56:08.087: %CAPWAP-3-EVENTLOG: The function which Posted the message to send out of the box is spamSendFastHeartbeatReques and of Type=21
    I checked the timers via show ap retransmit all
    (WLC) >show ap retransmit all  Global control packet retransmit interval: 3 (default) Global control packet retransmit count: 5 (default)AP Name             Retransmit Interval  Retransmit count------------------  -------------------  -------------------Access-Point             3 (default)      5 (default)
    It only shows the timers for the normal heartbeat procedure.
    I then proceeded to change the retransmit count parameter to 8
    (WLC) >show ap retransmit all Global control packet retransmit interval: 3 (default)Global control packet retransmit count: 8AP Name             Retransmit Interval  Retransmit count------------------  -------------------  -------------------Access-Point             3 (default)      8
    With fast heartbeat disabled it turned out that during a heartbeat timeout the retransmit count will use the new value of 8.
    *Feb 8 12:04:12.679: %CAPWAP-3-EVENTLOG: Sending packet to AC*Feb 8 12:04:12.981: %CAPWAP-3-EVENTLOG: Echo Interval Expired.*Feb 8 12:04:12.981: %CAPWAP-3-EVENTLOG: Echo Request sent to *Feb 8 12:04:15.680: %CAPWAP-3-EVENTLOG: Retransmission Count= 0 Max Re-Transmission Value=8*Feb 8 12:04:15.680: %CAPWAP-3-EVENTLOG: Sending packet to AC*Feb 8 12:04:18.681: %CAPWAP-3-EVENTLOG: Retransmission Count= 1 Max Re-Transmission Value=8*Feb  8 12:04:18.681: %CAPWAP-3-EVENTLOG: Sending packet to AC*Feb 8 12:04:21.683: %CAPWAP-3-EVENTLOG: Retransmission Count= 2 Max Re-Transmission Value=8*Feb 8 12:04:21.683: %CAPWAP-3-EVENTLOG: Sending packet to AC*Feb 8 12:04:24.684: %CAPWAP-3-EVENTLOG: Retransmission Count= 3 Max Re-Transmission Value=8*Feb 8 12:04:24.684: %CAPWAP-3-EVENTLOG: Sending packet to AC*Feb 8 12:04:27.685: %CAPWAP-3-EVENTLOG: Retransmission Count= 4 Max Re-Transmission Value=8*Feb 8 12:04:27.685: %CAPWAP-3-EVENTLOG: Sending packet to AC*Feb 8 12:04:30.686: %CAPWAP-3-EVENTLOG: Retransmission Count= 5 Max Re-Transmission Value=8*Feb 8 12:04:30.686: %CAPWAP-3-EVENTLOG: Sending packet to AC*Feb 8 12:04:33.687: %CAPWAP-3-EVENTLOG: Retransmission Count= 6 Max Re-Transmission Value=8*Feb 8 12:04:33.687: %CAPWAP-3-EVENTLOG: Sending packet to AC*Feb 8 12:04:36.688: %CAPWAP-3-EVENTLOG: Retransmission Count= 7 Max Re-Transmission Value=8*Feb 8 12:04:36.688: %CAPWAP-3-EVENTLOG: Sending packet to AC*Feb 8 12:04:39.689: %CAPWAP-3-EVENTLOG: Retransmission Count= 8 Max Re-Transmission Value=8*Feb 8 12:04:39.689: %CAPWAP-3-EVENTLOG: Max retransmission count exceeded going back to DISCOVER mode.*Feb 8 12:04:39.689: %CAPWAP-3-EVENTLOG: The function which Posted the message to send out of the box is lwapp_send_rm_data_reques and of Type=8
    Now when I enabled fast-heartbeat again and did a test I noticed that the AP now also sends 8 retransmissions before it changes to the backup WLC
    *Feb  8 12:09:06.155: %CAPWAP-3-EVENTLOG: Sending packet to AC*Feb  8 12:09:06.155: %CAPWAP-3-EVENTLOG: HeartBeat request sent to *Feb  8 12:09:09.156: %CAPWAP-3-EVENTLOG: Retransmission Count= 0 Max Re-Transmission Value=8*Feb 8 12:09:09.156: %CAPWAP-3-EVENTLOG: Sending packet to AC*Feb 8 12:09:11.157: %CAPWAP-3-EVENTLOG: HeartBeat request sent to *Feb 8 12:09:12.157: %CAPWAP-3-EVENTLOG: Retransmission Count= 1 Max Re-Transmission Value=8*Feb 8 12:09:12.157: %CAPWAP-3-EVENTLOG: Sending packet to AC*Feb 8 12:09:15.158: %CAPWAP-3-EVENTLOG: Retransmission Count= 2 Max Re-Transmission Value=8*Feb 8 12:09:15.158: %CAPWAP-3-EVENTLOG: Sending packet to AC*Feb 8 12:09:16.158: %CAPWAP-3-EVENTLOG: HeartBeat request sent to *Feb 8 12:09:18.159: %CAPWAP-3-EVENTLOG: Retransmission Count= 3 Max Re-Transmission Value=8*Feb 8 12:09:18.159: %CAPWAP-3-EVENTLOG: Sending packet to AC*Feb 8 12:09:21.160: %CAPWAP-3-EVENTLOG: HeartBeat request sent to *Feb 8 12:09:21.160: %CAPWAP-3-EVENTLOG: Retransmission Count= 4 Max Re-Transmission Value=8*Feb 8 12:09:21.160: %CAPWAP-3-EVENTLOG: Sending packet to AC*Feb 8 12:09:24.161: %CAPWAP-3-EVENTLOG: Retransmission Count= 5 Max Re-Transmission Value=8*Feb 8 12:09:24.161: %CAPWAP-3-EVENTLOG: Sending packet to AC*Feb 8 12:09:26.162: %CAPWAP-3-EVENTLOG: HeartBeat request sent to *Feb 8 12:09:27.162: %CAPWAP-3-EVENTLOG: Retransmission Count= 6 Max Re-Transmission Value=8*Feb 8 12:09:27.162: %CAPWAP-3-EVENTLOG: Sending packet to AC*Feb 8 12:09:30.163: %CAPWAP-3-EVENTLOG: Retransmission Count= 7 Max Re-Transmission Value=8*Feb 8 12:09:30.163: %CAPWAP-3-EVENTLOG: Sending packet to AC*Feb 8 12:09:31.163: %CAPWAP-3-EVENTLOG: HeartBeat request sent to *Feb 8 12:09:31.173: %CAPWAP-3-EVENTLOG: Echo Interval Expired.*Feb 8 12:09:31.173: %CAPWAP-3-EVENTLOG: Echo Request sent to *Feb 8 12:09:33.164: %CAPWAP-3-EVENTLOG: Retransmission Count= 8 Max Re-Transmission Value=8*Feb 8 12:09:33.164: %CAPWAP-3-EVENTLOG: Max retransmission count exceeded going back to DISCOVER mode.*Feb 8 12:09:33.164: %CAPWAP-3-EVENTLOG: The function which Posted the message to send out of the box is spamSendFastHeartbeatReques and of Type=21
    I then decided to switch back to the default retransmit count value of 5 but noticed that the default label is now missing in the WLC config:
    (WLC) >show ap retransmit all  Global control packet retransmit interval: 3 (default) Global control packet retransmit count: 5AP Name             Retransmit Interval  Retransmit count------------------  -------------------  -------------------Access-Point             3 (default)      5
    I did another debug with fast-heartbeat enabled which confirmed my suspicion. The retransmit count stays at 5 counts instead of only 3.
    *Feb 8 12:13:40.221: %CAPWAP-3-EVENTLOG: Sending packet to AC*Feb 8 12:13:40.221: %CAPWAP-3-EVENTLOG: HeartBeat request sent to *Feb 8 12:13:43.222: %CAPWAP-3-EVENTLOG: Retransmission Count= 0 Max Re-Transmission Value=5*Feb 8 12:13:43.222: %CAPWAP-3-EVENTLOG: Sending packet to AC*Feb 8 12:13:45.222: %CAPWAP-3-EVENTLOG: HeartBeat request sent to *Feb 8 12:13:46.223: %CAPWAP-3-EVENTLOG: Retransmission Count= 1 Max Re-Transmission Value=5*Feb 8 12:13:46.223: %CAPWAP-3-EVENTLOG: Sending packet to AC*Feb 8 12:13:49.224: %CAPWAP-3-EVENTLOG: Retransmission Count= 2 Max Re-Transmission Value=5*Feb 8 12:13:49.224: %CAPWAP-3-EVENTLOG: Sending packet to AC*Feb 8 12:13:50.224: %CAPWAP-3-EVENTLOG: HeartBeat request sent to *Feb 8 12:13:52.225: %CAPWAP-3-EVENTLOG: Retransmission Count= 3 Max Re-Transmission Value=5*Feb 8 12:13:52.225: %CAPWAP-3-EVENTLOG: Sending packet to AC*Feb 8 12:13:55.226: %CAPWAP-3-EVENTLOG: HeartBeat request sent to *Feb 8 12:13:55.226: %CAPWAP-3-EVENTLOG: Retransmission Count= 4 Max Re-Transmission Value=5*Feb 8 12:13:55.226: %CAPWAP-3-EVENTLOG: Sending packet to AC*Feb 8 12:13:58.227: %CAPWAP-3-EVENTLOG: Retransmission Count= 5 Max Re-Transmission Value=5*Feb 8 12:13:58.227: %CAPWAP-3-EVENTLOG: Max retransmission count exceeded going back to DISCOVER mode.*Feb 8 12:13:58.227: %CAPWAP-3-EVENTLOG: The function which Posted the message to send out of the box is spamSendFastHeartbeatReques and of Type=21
    Now to my question:
    Is there any way to restore the default behaviour of the timers?
    I didn’t find a command to clear this configuration, already tried to reboot the WLC, but nothing helped.
    Any help appreciated.

  • Cisco ISE: HotFix and Timers for 802.1x (EAP-TLS)

    Hi,
    I found the below Hot-Fix to be set;
    http://blogs.technet.com/b/jeff_stokes/archive/2013/01/24/20-minute-delay-deploying-windows-7-on-802-1x-fix-it-here.aspx
    Kindly let me know that what is the best time to be set on it. It tells 20 mintues. Also, i wanna know that what is the corresponding configuration needs on Switch and ISE to reflect it or doesn't need it.
    Thanks,
    Regards,
    Mubasher Sultan

    Hello Mubashir,
    Many timers can be modified as  needed in a deployment. Unless you are experiencing a specific problem  where adjusting the timer may correct unwanted behavior, it is  recommended to leave all timers at their default values except for the  802.1X transmit timer (tx-period).
    The tx-period timer defaults to a value of 30 seconds.  Leaving this value at 30 seconds provides a default wait of 90 seconds  (3 x tx-period) before a switchport will begin the next method of  authentication, and begin the MAB process for non-authenticating  devices.
    Based on numerous deployments, the best-practice  recommendation is to set the tx-period value to 10 seconds to provide  the optimal time for MAB devices. Setting the value below 10 seconds may  result in the port moving to MAC authentication bypass too quickly.
    Configure the tx-period timer.
    C3750X(config-if-range)#dot1x timeout tx-period 10

  • Cisco ISE: 802.1x Timers Best Practices / Re-authentication Timers [EAP-TLS]

    Dear Folks,
    Kindly, suggest the best recommended values for the timers in 802.1x (EAP-TLS)... Should i keep default all or change or some of them?
    Also, what do we need reauthentication timers? Any benefit to use it? Does it prompt to users or became invisible? and What are the best values, in case if we need to use it?
    Thanks,
    Regards,
    Mubasher
    My Interface Configuration is as below;
    interface GigabitEthernet1/34
    switchport access vlan 131
    switchport mode access
    switchport voice vlan 195
    ip access-group ACL-DEFAULT in
    authentication event fail action authorize vlan 131
    authentication event server dead action authorize vlan 131
    authentication event server alive action reinitialize
    authentication open
    authentication order dot1x mab
    authentication priority dot1x mab
    authentication port-control auto
    mab
    snmp trap mac-notification change added
    dot1x pae authenticator
    dot1x timeout tx-period 5
    storm-control broadcast level 30.00
    spanning-tree portfast
    spanning-tree bpduguard enable

    Hello Mubashir,
    Many timers can be modified as needed in a deployment. Unless you are experiencing a specific problem where adjusting the timer may correct unwanted behavior, it is recommended to leave all timers at their default values except for the 802.1X transmit timer (tx-period).
    The tx-period timer defaults to a value of 30 seconds. Leaving this value at 30 seconds provides a default wait of 90 seconds (3 x tx-period) before a switchport will begin the next method of authentication, and begin the MAB process for non-authenticating devices.
    Based on numerous deployments, the best-practice recommendation is to set the tx-period value to 10 seconds to provide the optimal time for MAB devices. Setting the value below 10 seconds may result in the port moving to MAC authentication bypass too quickly.
    Configure the tx-period timer.
    C3750X(config-if-range)#dot1x timeout tx-period 10

  • How to cancel Timers permanently?

    We are running our application in Weblogic 10.3. We have an EJB timer that runs all the time and kicks off a piece of code every x minutes. The problem is when an Exception happens and we cancel the timer the timer gets cancelled but some references still remain in the memory which will cause issues when the next time we run the application. (A new timer is then created but the old timer seems to be still there.)
    The way we cancel the timer is as follows:
    Collection timers = ctx.getTimerService().getTimers();
    Collection<Timer> list = timers;
    Iterator<Timer> it = list.iterator();
    while(it.hasNext){
    timer = it.next();
    timer.cancel();
    }

    More information from my findings. If you print the timers to logs, you'll see that the states are different.
    [EJB Timer] id: 146 pk: 1 info: null timer: 1317710283134.17107(60000) state: 2 ejb: PropertyFileRefreshBean(Application: FCM, EJBComponent: FCM_EJB.jar) Thread: Thread[[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads]
    I see state 2 when it is running. And when I perform timer.cancel(), depending on whether it is a transaction or not, it will set the state to 6 or 7. A state 7 will have the timer removed from the sessionContext immediately (I've checked this in the weblogic.jar TimerImpl source). However a state 6 will only mean that the timer has been canceled, but it remains in the session context.
    The problem with my code is that I am checking if getTimer.isEmpty(), which unfortunately, it is not because it is in state 6.
    I'm not sure why doing timer.cancel in 2 different weblogic env (version 9.2 and version 10.3) can result in different states. But I have soon traced the problem to the weblogic-ejb-jar.xml descriptor file. Previously, I was running on a version 8.1 descriptor file. I have then used the DDConvertor tool in in weblogic 10.3 to convert it to the latest. And for some reasons, the timer's behaviour started acting differently.
    What is strange is that, apart from the descriptor header, everything else in the descriptor remains the same. None of the tags, attributes, etc has additional or lesser information. They are totally identical. But the output from the timer was different.
    I hope this helps. Anyone care to shed some light on what I have done wrong?

  • Window service Timers.Timer

    Hi Guys Please help me.
    Actully i create a window service. This window service has timer for update record once in a day at 5 pm.
    I have write a code but it is not working fin
    Here is my code.
    App.Config File:-
    <appSettings>  
        <add key="IsTrace" value="YES"/>
        <add key="SourceServerPath" value="Server=DATASERVER\SQL2008R2;database=WDSBHN;User ID=Wireless;pwd=chetu@123"/>
        <add key="ArchiveServerPath" value="Server=CHETUIWK091\SQL2008R2;database=Demo;User ID=sa;pwd=Chetu@123"/>
        <add key="ReportHour" value="22"/>
        <add key="ReportMinut" value="01"/>
        <add key="ReportSecond" value="20"/>
        <add key="ReportMilisecond" value="230"/>
        <add key="DailyTimer" value="tmrProductionDataTransfer"/>
        <add key="MonthlyTimer" value="tmrProductionCleanUp"/>
        <add key="ActionParameter" value="WDS-DataTransfer"/>
      </appSettings>   
    Vb.Net Code:-
    Protected Overrides Sub OnStart(ByVal args() As String)
            ' Add code here to start your service. This method should set things
            ' in motion so your service can do its work.
            Try
                LoggingTracing.WriteTrace("DataTransfer Service START " & Now.ToLongDateString & " " & Now.ToLongTimeString())
                '***Get the Time of service run
                Dim svcRunTime As System.DateTime = Configuration.ConfigurationManager.AppSettings("ServiceRunTime")
                '***differance of these two time
                Dim ts As TimeSpan = DateTime.Now.Subtract(svcRunTime)
                '***production data transfer
                tmrProductionDataTransfer.Enabled = True
                tmrProductionDataTransfer.Interval = 1000
                tmrProductionDataTransfer.Start()
            Catch ex As Exception
                LoggingTracing.WriteError(ex.ToString())
            End Try
        End Sub
    Private Sub tmrProductionDataTransfer_Elapsed(sender As Object, e As Timers.ElapsedEventArgs) Handles tmrProductionDataTransfer.Elapsed
            Try
                Dim time As Date = Date.Now
                Dim currHour As Integer
                Dim currMinute As Integer
                Dim currnSecond As Integer
                Dim reportHour As Integer
                Dim reportMinute As Integer
                Dim reportSecond As Integer
                Dim reportMiliSecond As Integer
                Dim actionParameter As String = Configuration.ConfigurationManager.AppSettings("ActionParameter")
                Dim actionTimerName As String = Configuration.ConfigurationManager.AppSettings("DailyTimer")
                currHour = time.Hour
                currMinute = time.Minute
                currnSecond = time.Second
                reportHour = Convert.ToInt32(Configuration.ConfigurationManager.AppSettings("ReportHour"))
                reportMinute = Convert.ToInt32(Configuration.ConfigurationManager.AppSettings("ReportMinut"))
                reportSecond = Convert.ToInt32(Configuration.ConfigurationManager.AppSettings("ReportSecond"))
                reportMiliSecond = Convert.ToInt32(Configuration.ConfigurationManager.AppSettings("ReportMilisecond"))
                If currHour = reportHour AndAlso currMinute = reportMinute AndAlso currnSecond = reportSecond Then
                    ObjProductionDataTransfer.CopyDataToArchiveServerDayWiseDL(Configuration.ConfigurationManager.AppSettings("SourceServerPath"), Configuration.ConfigurationManager.AppSettings("ArchiveServerPath"),
    actionTimerName, time, actionParameter)
                End If
            Catch ex As Exception
                LoggingTracing.WriteError(ex.ToString())
            End Try
        End Sub
    It is running at 5 pm , but run 3 times, for that records has updated 3 time 
    How i can resolve it, If any problem in this code please give me the write direction or code. And this thing i have been searching for 3 days , but stile i didn't get any solution
    sonesh

    Sonesh,
    Sorry but you have posted to a forum that deals exclusively with questions/issues about customizing and programming Microsoft Project, a planning and scheduling application. I suggest you delete this post and find a forum appropriate for your issue.
    John

Maybe you are looking for

  • Can "Common Project" be used for collecting AP Invoices?

    Hello Gurus, I have a question regarding Project Manufacturing and Project Costing. In the PJM Organization Parameters setup, you can define a Common Project to collect cost in PA module as expenditures for non-project related transactions. Does this

  • Apple tv 1st gen starts to sync then freezes up

    wanted to add somemore christmas tunes to my 1st gen. apple tv.would not let me sync.did everything the set-up shows.apple support said to reset atv back to factory settings.I would loose content (14,000 songs)but could sync them over again.Now every

  • Personal File Sharing won't be turned on anymore

    Under the Sharing System Preference, the Personal File Sharing will not be turned on anymore. When I select it, "File Sharing staring up . . ." message comes up, but it stays like that forever. Because of this problem, I can not share my files with o

  • Neo V very Slow after ICS Update.. :(

    Updated to ICS on my Neo V and facing many issues. The major issue is that ph.is very slow and hangs a lot if 2-3 apps are running at the same time and at the time when ph. hangs not even the power button works, the only option is to reinsert the bat

  • I have new HP 1050.It prints perfectly but shows a broad 2 inch band while copying and scanning.

    What could be the problem????Is there an HP helpline available locally in Mumbai??? HP1050 shws a 2 inch black band while scanning and copying!!!!It's brand new!!HELP