Exemplo n.º 1
0
 private synchronized void setState(byte newState) {
   if (state == DESTROYED) return;
   state = newState;
   if (state == CONNECTING) {
     seqSend = 0;
     seqRcv = 0;
   } else if (state == OPEN_IDLE) restartTimer();
   else if (state == OPEN_WAIT) restartTimer();
   else if (state == DISCONNECTED) {
     if (timer != null) timer.dormant();
   } else if (state == DESTROYED) if (timer != null) timer.quit();
 }
Exemplo n.º 2
0
 private void restartTimer() {
   if (!co) throw new KNXIllegalStateException("no timer if not connection oriented");
   if (state == DESTROYED) return;
   if (timer != null) timer.restart();
   else timer = new ConnectionTimeout();
 }