From 1052f99a2f4d051f08e507fc9aa3e40846421cd8 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Thu, 9 Jun 2016 13:53:01 +1200 Subject: Fix minor issues in LDPL protocol --- src/org/traccar/protocol/LdplProtocol.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/org/traccar/protocol/LdplProtocol.java') 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 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)); -- cgit v1.2.3