aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/protocol/TranSyncProtocol.java
diff options
context:
space:
mode:
authorNikolay Vlahovski <nvlahovski@gmail.com>2023-05-17 11:00:43 +0300
committerNikolay Vlahovski <nvlahovski@gmail.com>2023-05-17 11:00:43 +0300
commit7e403cf979d3c01acb5b3dfe0ee37dfa83cba4ff (patch)
treee4e8180b5a6e239279fbc4950b9a6db8409409ff /src/main/java/org/traccar/protocol/TranSyncProtocol.java
parent8ee05feeafbf7c6356e1afd65e140823c717aef8 (diff)
downloadtrackermap-server-7e403cf979d3c01acb5b3dfe0ee37dfa83cba4ff.tar.gz
trackermap-server-7e403cf979d3c01acb5b3dfe0ee37dfa83cba4ff.tar.bz2
trackermap-server-7e403cf979d3c01acb5b3dfe0ee37dfa83cba4ff.zip
Add LengthFieldBasedFrameDecoder to TranSyncProtocol
Diffstat (limited to 'src/main/java/org/traccar/protocol/TranSyncProtocol.java')
-rw-r--r--src/main/java/org/traccar/protocol/TranSyncProtocol.java19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/main/java/org/traccar/protocol/TranSyncProtocol.java b/src/main/java/org/traccar/protocol/TranSyncProtocol.java
index 0634642df..39db67585 100644
--- a/src/main/java/org/traccar/protocol/TranSyncProtocol.java
+++ b/src/main/java/org/traccar/protocol/TranSyncProtocol.java
@@ -1,5 +1,22 @@
+/*
+ * Copyright 2013 - 2023 Anton Tananaev (anton@traccar.org)
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.traccar.protocol;
+import io.netty.handler.codec.LengthFieldBasedFrameDecoder;
+import io.netty.handler.codec.LineBasedFrameDecoder;
import org.traccar.BaseProtocol;
import org.traccar.PipelineBuilder;
import org.traccar.TrackerServer;
@@ -14,9 +31,9 @@ public class TranSyncProtocol extends BaseProtocol {
addServer(new TrackerServer(config, getName(), false) {
@Override
protected void addProtocolHandlers(PipelineBuilder pipeline, Config config) {
+ pipeline.addLast(new LengthFieldBasedFrameDecoder(256, 2, 1, 2, 0, true));
pipeline.addLast(new TranSyncProtocolDecoder(TranSyncProtocol.this));
}
});
}
-
}