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.java17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/org/traccar/ServerManager.java b/src/org/traccar/ServerManager.java
index 59d98af0e..836b1e3ff 100644
--- a/src/org/traccar/ServerManager.java
+++ b/src/org/traccar/ServerManager.java
@@ -140,6 +140,7 @@ public class ServerManager {
initWondexServer("wondex");
initCellocatorServer("cellocator");
initGalileoServer("galileo");
+ initYwtServer("ywt");
// Initialize web server
if (Boolean.valueOf(properties.getProperty("http.enable"))) {
@@ -746,5 +747,21 @@ public class ServerManager {
serverList.add(server);
}
}
+
+ private void initYwtServer(String protocol) throws SQLException {
+ if (isProtocolEnabled(properties, protocol)) {
+ serverList.add(new TrackerServer(this, new ServerBootstrap(), protocol) {
+ @Override
+ protected void addSpecificHandlers(ChannelPipeline pipeline) {
+ byte delimiter[] = { (byte) '\r', (byte) '\n' };
+ pipeline.addLast("frameDecoder",
+ new DelimiterBasedFrameDecoder(1024, ChannelBuffers.wrappedBuffer(delimiter)));
+ pipeline.addLast("stringDecoder", new StringDecoder());
+ pipeline.addLast("stringEncoder", new StringEncoder());
+ pipeline.addLast("objectDecoder", new YwtProtocolDecoder(ServerManager.this));
+ }
+ });
+ }
+ }
}