diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2018-06-03 11:46:55 +1200 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2018-06-03 11:46:55 +1200 |
commit | f0d1a5df7aecf1237609200d3ecb7cdd3d0abcab (patch) | |
tree | c82ad82bdb77e0e33340d6a020dc0912448f60d8 /src/org/traccar/protocol/Gps103Protocol.java | |
parent | 06e3bd8b16da12baafc9a97ba5949b3f7ffb5e07 (diff) | |
download | trackermap-server-f0d1a5df7aecf1237609200d3ecb7cdd3d0abcab.tar.gz trackermap-server-f0d1a5df7aecf1237609200d3ecb7cdd3d0abcab.tar.bz2 trackermap-server-f0d1a5df7aecf1237609200d3ecb7cdd3d0abcab.zip |
Properly handle datagram channels
Diffstat (limited to 'src/org/traccar/protocol/Gps103Protocol.java')
-rw-r--r-- | src/org/traccar/protocol/Gps103Protocol.java | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/org/traccar/protocol/Gps103Protocol.java b/src/org/traccar/protocol/Gps103Protocol.java index aa96215da..cdf6e10a9 100644 --- a/src/org/traccar/protocol/Gps103Protocol.java +++ b/src/org/traccar/protocol/Gps103Protocol.java @@ -16,8 +16,8 @@ package org.traccar.protocol; import io.netty.channel.ChannelPipeline; -import io.netty.handler.codec.string.StringDecoder; -import io.netty.handler.codec.string.StringEncoder; +import org.traccar.AdvancedStringDecoder; +import org.traccar.AdvancedStringEncoder; import org.traccar.BaseProtocol; import org.traccar.CharacterDelimiterFrameDecoder; import org.traccar.TrackerServer; @@ -45,19 +45,19 @@ public class Gps103Protocol extends BaseProtocol { public void initTrackerServers(List<TrackerServer> serverList) { serverList.add(new TrackerServer(false, getName()) { @Override - protected void addSpecificHandlers(ChannelPipeline pipeline) { + protected void addProtocolHandlers(ChannelPipeline pipeline) { pipeline.addLast("frameDecoder", new CharacterDelimiterFrameDecoder(2048, "\r\n", "\n", ";")); - pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("stringDecoder", new StringDecoder()); + pipeline.addLast("stringEncoder", new AdvancedStringEncoder()); + pipeline.addLast("stringDecoder", new AdvancedStringDecoder()); pipeline.addLast("objectEncoder", new Gps103ProtocolEncoder()); pipeline.addLast("objectDecoder", new Gps103ProtocolDecoder(Gps103Protocol.this)); } }); serverList.add(new TrackerServer(true, getName()) { @Override - protected void addSpecificHandlers(ChannelPipeline pipeline) { - pipeline.addLast("stringEncoder", new StringEncoder()); - pipeline.addLast("stringDecoder", new StringDecoder()); + protected void addProtocolHandlers(ChannelPipeline pipeline) { + pipeline.addLast("stringEncoder", new AdvancedStringEncoder()); + pipeline.addLast("stringDecoder", new AdvancedStringDecoder()); pipeline.addLast("objectEncoder", new Gps103ProtocolEncoder()); pipeline.addLast("objectDecoder", new Gps103ProtocolDecoder(Gps103Protocol.this)); } |