aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol/LdplProtocol.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/org/traccar/protocol/LdplProtocol.java')
-rw-r--r--src/org/traccar/protocol/LdplProtocol.java7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/org/traccar/protocol/LdplProtocol.java b/src/org/traccar/protocol/LdplProtocol.java
index 517055f2f..01780a645 100644
--- a/src/org/traccar/protocol/LdplProtocol.java
+++ b/src/org/traccar/protocol/LdplProtocol.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2013 - 2014 Anton Tananaev (anton.tananaev@gmail.com)
+ * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -18,7 +18,9 @@ package org.traccar.protocol;
import java.util.List;
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.LineBasedFrameDecoder;
import org.jboss.netty.handler.codec.string.StringDecoder;
import org.jboss.netty.handler.codec.string.StringEncoder;
import org.traccar.BaseProtocol;
@@ -32,9 +34,10 @@ public class LdplProtocol extends BaseProtocol {
@Override
public void initTrackerServers(List<TrackerServer> serverList) {
- serverList.add(new TrackerServer(new ConnectionlessBootstrap(), this.getName()) {
+ serverList.add(new TrackerServer(new ServerBootstrap(), this.getName()) {
@Override
protected void addSpecificHandlers(ChannelPipeline pipeline) {
+ pipeline.addLast("frameDecoder", new LineBasedFrameDecoder(1024));
pipeline.addLast("stringEncoder", new StringEncoder());
pipeline.addLast("stringDecoder", new StringDecoder());
pipeline.addLast("objectDecoder", new LdplProtocolDecoder(LdplProtocol.this));