aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/main/java/org/traccar/protocol/T55ProtocolDecoder.java7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/main/java/org/traccar/protocol/T55ProtocolDecoder.java b/src/main/java/org/traccar/protocol/T55ProtocolDecoder.java
index 90382439e..51f06a801 100644
--- a/src/main/java/org/traccar/protocol/T55ProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/T55ProtocolDecoder.java
@@ -379,11 +379,12 @@ public class T55ProtocolDecoder extends BaseProtocolDecoder {
}
deviceSession = getDeviceSession(channel, remoteAddress, id);
sentence = sentence.substring(index);
- } else if (remoteAddress instanceof InetSocketAddress) {
- String host = ((InetSocketAddress) remoteAddress).getHostString();
- deviceSession = getDeviceSession(channel, remoteAddress, host);
} else {
deviceSession = getDeviceSession(channel, remoteAddress);
+ if (deviceSession == null && remoteAddress instanceof InetSocketAddress) {
+ String host = ((InetSocketAddress) remoteAddress).getHostString();
+ deviceSession = getDeviceSession(channel, remoteAddress, host);
+ }
}
if (sentence.startsWith("$PGID")) {