aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2015-10-16 09:55:45 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2015-10-16 09:55:45 +1300
commitb4ea2cfece4d5cb24f47fa6cc667f0ad53e02335 (patch)
treed3d707bf6d660a2bbcdcfb678a9278bd8f42f2f3 /src/org/traccar/protocol
parenta6b06189ea0f1b5a68c9cab49d50eccd98328bfa (diff)
downloadtrackermap-server-b4ea2cfece4d5cb24f47fa6cc667f0ad53e02335.tar.gz
trackermap-server-b4ea2cfece4d5cb24f47fa6cc667f0ad53e02335.tar.bz2
trackermap-server-b4ea2cfece4d5cb24f47fa6cc667f0ad53e02335.zip
Add TCP support for Gator protocol
Diffstat (limited to 'src/org/traccar/protocol')
-rw-r--r--src/org/traccar/protocol/GatorProtocol.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/org/traccar/protocol/GatorProtocol.java b/src/org/traccar/protocol/GatorProtocol.java
index e2626b5ab..3776bcfd3 100644
--- a/src/org/traccar/protocol/GatorProtocol.java
+++ b/src/org/traccar/protocol/GatorProtocol.java
@@ -16,7 +16,9 @@
package org.traccar.protocol;
import org.jboss.netty.bootstrap.ConnectionlessBootstrap;
+import org.jboss.netty.bootstrap.ServerBootstrap;
import org.jboss.netty.channel.ChannelPipeline;
+import org.jboss.netty.handler.codec.frame.LengthFieldBasedFrameDecoder;
import org.traccar.BaseProtocol;
import org.traccar.TrackerServer;
@@ -30,6 +32,13 @@ public class GatorProtocol extends BaseProtocol {
@Override
public void initTrackerServers(List<TrackerServer> serverList) {
+ serverList.add(new TrackerServer(new ServerBootstrap(), this.getName()) {
+ @Override
+ protected void addSpecificHandlers(ChannelPipeline pipeline) {
+ pipeline.addLast("frameDecoder", new LengthFieldBasedFrameDecoder(1024, 3, 2, 1, 0));
+ pipeline.addLast("objectDecoder", new GatorProtocolDecoder(GatorProtocol.this));
+ }
+ });
serverList.add(new TrackerServer(new ConnectionlessBootstrap(), this.getName()) {
@Override
protected void addSpecificHandlers(ChannelPipeline pipeline) {