From ff23b231b678536e2d395680c5f9fb0f73e2ddd8 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sat, 7 May 2016 10:55:35 +1200 Subject: Do not use idle timeout for UDP --- debug.xml | 1 - src/org/traccar/BasePipelineFactory.java | 2 +- src/org/traccar/TrackerServer.java | 4 ++++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/debug.xml b/debug.xml index 683957eed..a70940108 100644 --- a/debug.xml +++ b/debug.xml @@ -196,7 +196,6 @@ 5001 - 5 5002 5003 5004 diff --git a/src/org/traccar/BasePipelineFactory.java b/src/org/traccar/BasePipelineFactory.java index 41053cde2..6e350f61d 100644 --- a/src/org/traccar/BasePipelineFactory.java +++ b/src/org/traccar/BasePipelineFactory.java @@ -129,7 +129,7 @@ public abstract class BasePipelineFactory implements ChannelPipelineFactory { @Override public ChannelPipeline getPipeline() { ChannelPipeline pipeline = Channels.pipeline(); - if (timeout != 0) { + if (timeout > 0 && !server.isConnectionless()) { pipeline.addLast("idleHandler", new IdleStateHandler(GlobalTimer.getTimer(), timeout, 0, 0)); } pipeline.addLast("openHandler", new OpenChannelHandler(server)); diff --git a/src/org/traccar/TrackerServer.java b/src/org/traccar/TrackerServer.java index ba1703e86..7bbab071d 100644 --- a/src/org/traccar/TrackerServer.java +++ b/src/org/traccar/TrackerServer.java @@ -37,6 +37,10 @@ public abstract class TrackerServer { private final Bootstrap bootstrap; private final String protocol; + public boolean isConnectionless() { + return bootstrap instanceof ConnectionlessBootstrap; + } + public String getProtocol() { return protocol; } -- cgit v1.2.3