diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2013-11-03 11:36:58 +1300 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2013-11-03 11:36:58 +1300 |
commit | 24b6fb1778d4d5c8835974fca92c00558323e0e2 (patch) | |
tree | 0a3a0e004058c8b0235ecb9c697bb2e9947461c5 /src/org/traccar/ServerManager.java | |
parent | f5627add0043dbb511d3d3ebe3cd507e16ab56e3 (diff) | |
download | trackermap-server-24b6fb1778d4d5c8835974fca92c00558323e0e2.tar.gz trackermap-server-24b6fb1778d4d5c8835974fca92c00558323e0e2.tar.bz2 trackermap-server-24b6fb1778d4d5c8835974fca92c00558323e0e2.zip |
Implement Sanav protocol (fix #421)
Diffstat (limited to 'src/org/traccar/ServerManager.java')
-rw-r--r-- | src/org/traccar/ServerManager.java | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/org/traccar/ServerManager.java b/src/org/traccar/ServerManager.java index 28a645e51..7e087f263 100644 --- a/src/org/traccar/ServerManager.java +++ b/src/org/traccar/ServerManager.java @@ -158,6 +158,7 @@ public class ServerManager { initM2mServer("m2m"); initOsmAndServer("osmand"); initEasyTrackServer("easytrack"); + initSanavServer("sanav"); // Initialize web server if (Boolean.valueOf(properties.getProperty("http.enable"))) { @@ -1017,5 +1018,18 @@ public class ServerManager { }); } } - + + private void initSanavServer(String protocol) throws SQLException { + if (isProtocolEnabled(properties, protocol)) { + serverList.add(new TrackerServer(this, new ServerBootstrap(), protocol) { + @Override + protected void addSpecificHandlers(ChannelPipeline pipeline) { + pipeline.addLast("frameDecoder", new LineBasedFrameDecoder(1024)); + pipeline.addLast("stringDecoder", new StringDecoder()); + pipeline.addLast("objectDecoder", new SanavProtocolDecoder(ServerManager.this)); + } + }); + } + } + } |