aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--debug.xml1
-rw-r--r--src/org/traccar/BasePipelineFactory.java11
2 files changed, 8 insertions, 4 deletions
diff --git a/debug.xml b/debug.xml
index a70940108..683957eed 100644
--- a/debug.xml
+++ b/debug.xml
@@ -196,6 +196,7 @@
<!-- PROTOCOL CONFIG -->
<entry key='gps103.port'>5001</entry>
+ <entry key='gps103.resetDelay'>5</entry>
<entry key='tk103.port'>5002</entry>
<entry key='gl100.port'>5003</entry>
<entry key='gl200.port'>5004</entry>
diff --git a/src/org/traccar/BasePipelineFactory.java b/src/org/traccar/BasePipelineFactory.java
index c166f47f4..41053cde2 100644
--- a/src/org/traccar/BasePipelineFactory.java
+++ b/src/org/traccar/BasePipelineFactory.java
@@ -36,7 +36,7 @@ import java.net.InetSocketAddress;
public abstract class BasePipelineFactory implements ChannelPipelineFactory {
private final TrackerServer server;
- private final int resetDelay;
+ private int timeout;
private FilterHandler filterHandler;
private DistanceHandler distanceHandler;
@@ -95,7 +95,10 @@ public abstract class BasePipelineFactory implements ChannelPipelineFactory {
public BasePipelineFactory(TrackerServer server, String protocol) {
this.server = server;
- resetDelay = Context.getConfig().getInteger(protocol + ".resetDelay", 0);
+ timeout = Context.getConfig().getInteger(protocol + ".timeout", 0);
+ if (timeout == 0) {
+ timeout = Context.getConfig().getInteger(protocol + ".resetDelay", 0); // temporary
+ }
if (Context.getConfig().getBoolean("filter.enable")) {
filterHandler = new FilterHandler();
@@ -126,8 +129,8 @@ public abstract class BasePipelineFactory implements ChannelPipelineFactory {
@Override
public ChannelPipeline getPipeline() {
ChannelPipeline pipeline = Channels.pipeline();
- if (resetDelay != 0) {
- pipeline.addLast("idleHandler", new IdleStateHandler(GlobalTimer.getTimer(), resetDelay, 0, 0));
+ if (timeout != 0) {
+ pipeline.addLast("idleHandler", new IdleStateHandler(GlobalTimer.getTimer(), timeout, 0, 0));
}
pipeline.addLast("openHandler", new OpenChannelHandler(server));
if (Context.isLoggerEnabled()) {