Fix KeepAlive message not being sent 27/1127/1
authorRobert Varga <rovarga@cisco.com>
Mon, 9 Sep 2013 10:43:02 +0000 (12:43 +0200)
committerRobert Varga <rovarga@cisco.com>
Mon, 9 Sep 2013 10:43:02 +0000 (12:43 +0200)
Change-Id: I4d843960c68b5258a8e41eaf52efb7520ae6b8d9
Signed-off-by: Robert Varga <rovarga@cisco.com>
pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/PCEPSessionImpl.java

index a2366a69adae6a3e5b8f5f4b9773a6b99ba13002..a9f811f398687d6019c4c00cce4d3f25f1a921c3 100644 (file)
@@ -169,14 +169,14 @@ class PCEPSessionImpl extends AbstractProtocolSession<PCEPMessage> implements PC
                        if (ct >= nextKeepalive) {
                                this.sendMessage(new PCEPKeepAliveMessage());
                                nextKeepalive = (long) (this.lastMessageSentAt + getKeepAliveTimerValue() * 1E9);
-                       } else {
-                               this.stateTimer.newTimeout(new TimerTask() {
-                                       @Override
-                                       public void run(final Timeout timeout) throws Exception {
-                                               handleKeepaliveTimer();
-                                       }
-                               }, nextKeepalive - ct, TimeUnit.NANOSECONDS);
                        }
+
+                       this.stateTimer.newTimeout(new TimerTask() {
+                               @Override
+                               public void run(final Timeout timeout) throws Exception {
+                                       handleKeepaliveTimer();
+                               }
+                       }, nextKeepalive - ct, TimeUnit.NANOSECONDS);
                }
        }