Coder Social home page Coder Social logo

Idle time not accurate when Windows 7 client system time not synchronized with Windows Server 2008 R2 server system time about cassia HOT 13 OPEN

GoogleCodeExporter avatar GoogleCodeExporter commented on August 22, 2024
Idle time not accurate when Windows 7 client system time not synchronized with Windows Server 2008 R2 server system time

from cassia.

Comments (13)

GoogleCodeExporter avatar GoogleCodeExporter commented on August 22, 2024
Thanks for reporting this issue. This is for 2008, not 2008 R2, right? Did you 
mean 4.31 seconds or 4.31 minutes? Can you download the latest build from the 
build server (http://teamcity.codebetter.com/project.html?projectId=project51 
-- login as a guest and use the artifacts link) and let me know whether the 
issue still exists in that version?

Original comment by danports on 13 Apr 2011 at 3:17

from cassia.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 22, 2024
1. sorry, its 4.31 minutes.
2. Cassia version 2.1.0.109 didn't solve the issue.
2. the tested remote servers versions are:

- 2008 SP2 x64
- 2008 R2

but I don't have the problem when running the test locally on those servers.

Also, I didn't check on 2008 x86.

Original comment by [email protected] on 13 Apr 2011 at 3:59

from cassia.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 22, 2024
OK, thanks. What Windows version is the client (the one running the Cassia code 
and calling GetRemoteServer) running?

Original comment by danports on 13 Apr 2011 at 4:54

from cassia.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 22, 2024
1. sorry, its 4.31 minutes.
2. Cassia version 2.1.0.109 didn't solve the issue.
2. the tested remote servers versions are:

- 2008 SP2 x64
- 2008 R2

but I don't have the problem when running the test locally on those servers.

Also, I didn't check on 2008 x86.

Original comment by [email protected] on 13 Apr 2011 at 5:34

from cassia.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 22, 2024
Windows 7 Professional x64

Original comment by [email protected] on 13 Apr 2011 at 5:36

from cassia.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 22, 2024
OK, I'll try to reproduce the issue on a Windows 7 x64 client + Windows Server 
2008 R2 x64 server.

Original comment by danports on 14 Apr 2011 at 1:15

  • Changed title: idle time for server 2008 x64 is reported with 4.31 additional minutes

from cassia.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 22, 2024
I was not able to reproduce this issue on the Win7/2008R2 combination that I 
mentioned. Could you provide a sample program that reproduces this issue for 
you? Also, are the client and server systems' clocks synchronized?

Original comment by danports on 14 Apr 2011 at 1:26

from cassia.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 22, 2024
You are correct. The issue was the time sync between the machines.

But when checking, the time was off also between the client (win7) and the 
server (2003), and the reported idle time in this case was correct (despite the 
offset).

Original comment by [email protected] on 14 Apr 2011 at 6:22

from cassia.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 22, 2024
Hm, interesting. Not sure whether there is anything that can be done about 
that, but I'll see if I can reproduce it.

Original comment by danports on 17 Apr 2011 at 12:21

  • Changed title: Idle time not accurate when Windows 7 client system time not synchronized with Windows Server 2008 R2 server system time
  • Added labels: Priority-Low
  • Removed labels: Priority-Medium

from cassia.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 22, 2024
well, as you gave me the direction the issue is time sync and I know what to 
look for, I've made a workaround.

with the idle time I also get the time of the remote machine and showing the 
idle with consideration of the offset (if detected).

Thanks.

Original comment by [email protected] on 17 Apr 2011 at 4:11

from cassia.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 22, 2024
How are you fetching the time on the remote machine? 
ITerminalServicesSession.CurrentTime? Just wondering if your workaround is one 
that would make sense to include in Cassia.

Another approach would be to ensure that all of your systems are synced to an 
authoritative time source (assuming you have administrative control over them).

Original comment by danports on 19 Apr 2011 at 1:14

from cassia.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 22, 2024
I'm using NetRemoteTOD Function to get the remote machines time
http://msdn.microsoft.com/en-us/library/aa370612%28v=vs.85%29.aspx

//////////////the following code is for C#

        private const int NERR_Success = 0;

        [DllImport("netapi32.dll", SetLastError=false)]
        private static extern uint NetApiBufferFree ( IntPtr Buffer );

        [DllImport ( "netapi32.dll", CharSet = CharSet.Unicode,
        SetLastError = false )]
        private static extern uint NetRemoteTOD ( string
        UncServerName, ref IntPtr BufferPtr );

        [StructLayout(LayoutKind.Sequential)]
        private struct TIME_OF_DAY_INFO
        {
            public uint tod_elapsedt;
            public uint tod_msecs;
            public uint tod_hours;
            public uint tod_mins;
            public uint tod_secs;
            public uint tod_hunds;
            public uint tod_timezone;
            public uint tod_tinterval;
            public uint tod_day;
            public uint tod_month;
            public uint tod_year;
            public uint tod_weekday;
        }

//////////////end code

Original comment by [email protected] on 19 Apr 2011 at 2:13

from cassia.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 22, 2024
I see. I'd rather avoid bringing in an unrelated API to work around what is 
likely an issue with the WTS API, but it is something to consider. Thanks.

Original comment by danports on 19 Apr 2011 at 2:32

from cassia.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.