aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/session
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2022-07-26 17:29:14 -0700
committerAnton Tananaev <anton@traccar.org>2022-07-26 17:29:14 -0700
commitc5f793815a6429d77c429f49c876f52062051f03 (patch)
tree1cf42fff6dc107ecaeff08bdb0d91b69ccad9b04 /src/main/java/org/traccar/session
parent535eb8d11fccfa7ba4bfcbe9e3d8a0bc9be8f247 (diff)
downloadtrackermap-server-c5f793815a6429d77c429f49c876f52062051f03.tar.gz
trackermap-server-c5f793815a6429d77c429f49c876f52062051f03.tar.bz2
trackermap-server-c5f793815a6429d77c429f49c876f52062051f03.zip
Handle connectionless protocols
Diffstat (limited to 'src/main/java/org/traccar/session')
-rw-r--r--src/main/java/org/traccar/session/ConnectionManager.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/main/java/org/traccar/session/ConnectionManager.java b/src/main/java/org/traccar/session/ConnectionManager.java
index 2d183ee22..262a302af 100644
--- a/src/main/java/org/traccar/session/ConnectionManager.java
+++ b/src/main/java/org/traccar/session/ConnectionManager.java
@@ -189,12 +189,14 @@ public class ConnectionManager implements BroadcastInterface {
}
}
- public void deviceDisconnected(Channel channel) {
+ public void deviceDisconnected(Channel channel, boolean supportsOffline) {
Endpoint endpoint = new Endpoint(channel, channel.remoteAddress());
Map<String, DeviceSession> endpointSessions = sessionsByEndpoint.remove(endpoint);
if (endpointSessions != null) {
for (DeviceSession deviceSession : endpointSessions.values()) {
- updateDevice(deviceSession.getDeviceId(), Device.STATUS_OFFLINE, null);
+ if (supportsOffline) {
+ updateDevice(deviceSession.getDeviceId(), Device.STATUS_OFFLINE, null);
+ }
sessionsByDeviceId.remove(deviceSession.getDeviceId());
cacheManager.removeDevice(deviceSession.getDeviceId());
}