summaryrefslogtreecommitdiff
path: root/java/src/IceInternal/Selector.java
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2010-11-17 11:04:59 +0100
committerBenoit Foucher <benoit@zeroc.com>2010-11-17 11:04:59 +0100
commit077410ad5d3c6824561161f7000b3c34496cf5d3 (patch)
treefc7ee5a8fb5221a7a935ca7f590d46e68ae9a66c /java/src/IceInternal/Selector.java
parentBug 4843 - fix for startup check for C# projects (diff)
downloadice-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.java8
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)
{