summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJanHolger <jan@bebendorf.eu>2021-12-01 18:21:56 +0100
committerJanHolger <jan@bebendorf.eu>2021-12-01 18:21:56 +0100
commite3f9330af263fba206c5901a5a23a26b9da52142 (patch)
treedfcff5d6fc7d90a08ccb5ed383b392beda5bc2f7
parent1a93ceffb3510c7000ed46ed9ba211f4db70f0ae (diff)
Added proper handling of SocketException's
-rw-r--r--src/main/java/com/lumaserv/bgp/BGPSession.java10
1 files 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);
}
}