diff options
author | Benoit Foucher <benoit@zeroc.com> | 2010-11-17 11:04:59 +0100 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2010-11-17 11:04:59 +0100 |
commit | 077410ad5d3c6824561161f7000b3c34496cf5d3 (patch) | |
tree | fc7ee5a8fb5221a7a935ca7f590d46e68ae9a66c /java/src/IceInternal/Selector.java | |
parent | Bug 4843 - fix for startup check for C# projects (diff) | |
download | ice-077410ad5d3c6824561161f7000b3c34496cf5d3.tar.bz2 ice-077410ad5d3c6824561161f7000b3c34496cf5d3.tar.xz ice-077410ad5d3c6824561161f7000b3c34496cf5d3.zip |
Fixed bug 4897 - Ice.ServerIdleTime doesn't work consistently
Diffstat (limited to 'java/src/IceInternal/Selector.java')
-rw-r--r-- | java/src/IceInternal/Selector.java | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/java/src/IceInternal/Selector.java b/java/src/IceInternal/Selector.java index f13abf2f0cf..f604b4d7e37 100644 --- a/java/src/IceInternal/Selector.java +++ b/java/src/IceInternal/Selector.java @@ -244,8 +244,14 @@ public final class Selector { if(timeout > 0) { + // + // NOTE: On some platforms, select() sometime returns slightly before + // the timeout (at least according to our monotonic time). To make sure + // timeouts are correctly detected, we wait for a little longer than + // the configured timeout (10ms). + // long before = IceInternal.Time.currentMonotonicTimeMillis(); - if(_selector.select(timeout * 1000) == 0) + if(_selector.select(timeout * 1000 + 10) == 0) { if(IceInternal.Time.currentMonotonicTimeMillis() - before >= timeout * 1000) { |