aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/ServerManager.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2014-01-18 19:07:39 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2014-01-18 19:07:39 +1300
commitba4af96c2b771e3984887de0a4d2d7338aed1270 (patch)
tree1a44ff7bd7d8292d67986b7c51aa1b50504050d1 /src/org/traccar/ServerManager.java
parent0f0bcf8bf31723e67d703d8ea67e40a921536d9a (diff)
downloadtrackermap-server-ba4af96c2b771e3984887de0a4d2d7338aed1270.tar.gz
trackermap-server-ba4af96c2b771e3984887de0a4d2d7338aed1270.tar.bz2
trackermap-server-ba4af96c2b771e3984887de0a4d2d7338aed1270.zip
Implement KHD protocol
Diffstat (limited to 'src/org/traccar/ServerManager.java')
-rw-r--r--src/org/traccar/ServerManager.java13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/org/traccar/ServerManager.java b/src/org/traccar/ServerManager.java
index cd8a670ce..8e2465a2b 100644
--- a/src/org/traccar/ServerManager.java
+++ b/src/org/traccar/ServerManager.java
@@ -159,6 +159,7 @@ public class ServerManager {
initOsmAndServer("osmand");
initEasyTrackServer("easytrack");
initTaipServer("taip");
+ initKhdServer("khd");
// Initialize web server
if (Boolean.valueOf(properties.getProperty("http.enable"))) {
@@ -1031,4 +1032,16 @@ public class ServerManager {
}
}
+ private void initKhdServer(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 LengthFieldBasedFrameDecoder(256, 3, 2));
+ pipeline.addLast("objectDecoder", new KhdProtocolDecoder(ServerManager.this));
+ }
+ });
+ }
+ }
+
}