diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2016-05-07 10:47:28 +1200 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2016-05-07 10:47:28 +1200 |
commit | 1f7e9473e1bc0faff0feab20c5b5f801df285ba3 (patch) | |
tree | 851949c50a93b2e8b3481e828b9c8acc0e451f60 | |
parent | cc66af4ff6887c9ce2f594e87d91cff87f11098e (diff) | |
download | traccar-server-1f7e9473e1bc0faff0feab20c5b5f801df285ba3.tar.gz traccar-server-1f7e9473e1bc0faff0feab20c5b5f801df285ba3.tar.bz2 traccar-server-1f7e9473e1bc0faff0feab20c5b5f801df285ba3.zip |
Rename reset delay to timeout
-rw-r--r-- | debug.xml | 1 | ||||
-rw-r--r-- | src/org/traccar/BasePipelineFactory.java | 11 |
2 files changed, 8 insertions, 4 deletions
@@ -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()) { |