aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/database/ConnectionManager.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/org/traccar/database/ConnectionManager.java')
-rw-r--r--src/org/traccar/database/ConnectionManager.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/org/traccar/database/ConnectionManager.java b/src/org/traccar/database/ConnectionManager.java
index 39ec465e6..1aa0dbc57 100644
--- a/src/org/traccar/database/ConnectionManager.java
+++ b/src/org/traccar/database/ConnectionManager.java
@@ -50,6 +50,15 @@ public class ConnectionManager {
public void setActiveDevice(long deviceId, Protocol protocol, Channel channel, SocketAddress remoteAddress) {
activeDevices.put(deviceId, new ActiveDevice(deviceId, protocol, channel, remoteAddress));
}
+
+ public void removeActiveDevice(Channel channel) {
+ for (ActiveDevice activeDevice : activeDevices.values()) {
+ if (activeDevice.getChannel() == channel) {
+ activeDevices.remove(activeDevice.getDeviceId());
+ break;
+ }
+ }
+ }
public ActiveDevice getActiveDevice(long deviceId) {
return activeDevices.get(deviceId);