From e3f9330af263fba206c5901a5a23a26b9da52142 Mon Sep 17 00:00:00 2001 From: JanHolger Date: Wed, 1 Dec 2021 18:21:56 +0100 Subject: Added proper handling of SocketException's --- src/main/java/com/lumaserv/bgp/BGPSession.java | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/lumaserv/bgp/BGPSession.java b/src/main/java/com/lumaserv/bgp/BGPSession.java index 669010b..3ffadd8 100644 --- a/src/main/java/com/lumaserv/bgp/BGPSession.java +++ b/src/main/java/com/lumaserv/bgp/BGPSession.java @@ -52,15 +52,11 @@ public class BGPSession implements Runnable { public void run() { try { while (!closed) { - try { - handle(BGPPacket.read(inputStream)); - } catch (SocketException ignored) { - closed = true; - configuration.getListener().onClose(this); - } + handle(BGPPacket.read(inputStream)); } } catch (IOException ex) { - ex.printStackTrace(); + closed = true; + configuration.getListener().onClose(this); } } -- cgit v1.2.3