diff options
author | Anton Tananaev <anton@traccar.org> | 2023-04-11 19:28:43 -0700 |
---|---|---|
committer | Anton Tananaev <anton@traccar.org> | 2023-04-11 19:28:43 -0700 |
commit | 5460739293ccd8e89adc9edb4653b4de28b09897 (patch) | |
tree | 796b971b28580daf1cf4ea022e1bd0739945be26 /src/main/java/org/traccar/handler | |
parent | d41d34de83ed755e0a51e5638e121391f84b275f (diff) | |
download | trackermap-server-5460739293ccd8e89adc9edb4653b4de28b09897.tar.gz trackermap-server-5460739293ccd8e89adc9edb4653b4de28b09897.tar.bz2 trackermap-server-5460739293ccd8e89adc9edb4653b4de28b09897.zip |
Handle closed connections
Diffstat (limited to 'src/main/java/org/traccar/handler')
-rw-r--r-- | src/main/java/org/traccar/handler/NetworkForwarderHandler.java | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/main/java/org/traccar/handler/NetworkForwarderHandler.java b/src/main/java/org/traccar/handler/NetworkForwarderHandler.java index a3792a3e5..2c586c973 100644 --- a/src/main/java/org/traccar/handler/NetworkForwarderHandler.java +++ b/src/main/java/org/traccar/handler/NetworkForwarderHandler.java @@ -61,4 +61,12 @@ public class NetworkForwarderHandler extends ChannelInboundHandlerAdapter { super.channelRead(ctx, msg); } + @Override + public void channelInactive(ChannelHandlerContext ctx) throws Exception { + if (!(ctx.channel() instanceof DatagramChannel)) { + networkForwarder.disconnect((InetSocketAddress) ctx.channel().remoteAddress()); + } + super.channelInactive(ctx); + } + } |