Back Midas Rome Roody Rootana
  Midas DAQ System  Not logged in ELOG logo
Entry  20 Nov 2003, Konstantin Olchanski, , midas timeout wraparound 
    Reply  20 Nov 2003, Konstantin Olchanski, , cannot shutdown defunct clients 
       Reply  20 Nov 2003, Stefan Ritt, , cannot shutdown defunct clients 
          Reply  20 Nov 2003, Konstantin Olchanski, , cannot shutdown defunct clients 
             Reply  20 Nov 2003, Stefan Ritt, , cannot shutdown defunct clients 
             Reply  20 Nov 2003, Renee Poutissou, , cannot shutdown defunct clients 
                Reply  24 Nov 2003, Stefan Ritt, , cannot shutdown defunct clients 
Message ID: 95     Entry time: 20 Nov 2003     In reply to: 94
Author: Stefan Ritt 
Topic:  
Subject: cannot shutdown defunct clients 
> INT == "int", wraparound in 1 month
> DWORD == "unsigned int", wraparound in 2 months
> 
> should we make it the 64-bit "long long" (or C98's "int64_t")?

Won't work on all supported compilers. The point is that DWORD wraps around in 
2 months, but the difference of two DWORDs is alywas positive, never negative 
like you had it. We only have to distinguish if the difference of the current 
time (im ms) minus the last_activity of a client is larget than the timeout, 
typically 10 seconds or so. If you have a wraparound on 32-bit DWORD, the 
difference is still ok. Like

current "time" : 0x0000 0100
last_activity:   0xFFFF FF00

then current_time - last_activity = 0x00000100 - 0xFFFFFF00 = 0x00000200 if 
calculated with 32-bit values.
ELOG V3.1.4-2e1708b5