aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/forward
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2023-04-11 19:28:43 -0700
committerAnton Tananaev <anton@traccar.org>2023-04-11 19:28:43 -0700
commit5460739293ccd8e89adc9edb4653b4de28b09897 (patch)
tree796b971b28580daf1cf4ea022e1bd0739945be26 /src/main/java/org/traccar/forward
parentd41d34de83ed755e0a51e5638e121391f84b275f (diff)
downloadtrackermap-server-5460739293ccd8e89adc9edb4653b4de28b09897.tar.gz
trackermap-server-5460739293ccd8e89adc9edb4653b4de28b09897.tar.bz2
trackermap-server-5460739293ccd8e89adc9edb4653b4de28b09897.zip
Handle closed connections
Diffstat (limited to 'src/main/java/org/traccar/forward')
-rw-r--r--src/main/java/org/traccar/forward/NetworkForwarder.java11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/main/java/org/traccar/forward/NetworkForwarder.java b/src/main/java/org/traccar/forward/NetworkForwarder.java
index 6abf2b7ba..0915aaa27 100644
--- a/src/main/java/org/traccar/forward/NetworkForwarder.java
+++ b/src/main/java/org/traccar/forward/NetworkForwarder.java
@@ -63,4 +63,15 @@ public class NetworkForwarder {
}
}
+ public void disconnect(InetSocketAddress source) {
+ Socket connectionTcp = connectionsTcp.remove(source);
+ if (connectionTcp != null) {
+ try {
+ connectionTcp.close();
+ } catch (IOException e) {
+ LOGGER.warn("Connection close error", e);
+ }
+ }
+ }
+
}