aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/ServerManager.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/org/traccar/ServerManager.java')
-rw-r--r--src/org/traccar/ServerManager.java21
1 files changed, 20 insertions, 1 deletions
diff --git a/src/org/traccar/ServerManager.java b/src/org/traccar/ServerManager.java
index 6734d343d..fe5745bc8 100644
--- a/src/org/traccar/ServerManager.java
+++ b/src/org/traccar/ServerManager.java
@@ -179,7 +179,9 @@ public class ServerManager {
initTramigoServer("tramigo");
initTr900Server("tr900");
initArdi01Server("ardi01");
-
+
+ initProtocolDetector();
+
// Initialize web server
if (Boolean.valueOf(properties.getProperty("http.enable"))) {
webServer = new WebServer(properties, dataManager.getDataSource());
@@ -233,6 +235,23 @@ public class ServerManager {
return false;
}
+ private void initProtocolDetector() throws SQLException {
+ String protocol = "detector";
+ if (isProtocolEnabled(properties, protocol)) {
+ serverList.add(new TrackerServer(this, new ServerBootstrap(), protocol) {
+ @Override
+ protected void addSpecificHandlers(ChannelPipeline pipeline) {
+ pipeline.addLast("detectorHandler", new DetectorHandler(serverList));
+ }
+ });
+ serverList.add(new TrackerServer(this, new ConnectionlessBootstrap(), protocol) {
+ @Override
+ protected void addSpecificHandlers(ChannelPipeline pipeline) {
+ pipeline.addLast("detectorHandler", new DetectorHandler(serverList));
+ }
+ });
+ }
+ }
private void initGps103Server(final String protocol) throws SQLException {
if (isProtocolEnabled(properties, protocol)) {
serverList.add(new TrackerServer(this, new ServerBootstrap(), protocol) {