aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gq/malwarefight/tokenapp
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/gq/malwarefight/tokenapp')
-rw-r--r--src/main/java/gq/malwarefight/tokenapp/Main.java3
-rw-r--r--src/main/java/gq/malwarefight/tokenapp/SocketThread.java4
2 files changed, 5 insertions, 2 deletions
diff --git a/src/main/java/gq/malwarefight/tokenapp/Main.java b/src/main/java/gq/malwarefight/tokenapp/Main.java
index 96b9cb3..f86711b 100644
--- a/src/main/java/gq/malwarefight/tokenapp/Main.java
+++ b/src/main/java/gq/malwarefight/tokenapp/Main.java
@@ -53,6 +53,7 @@ public class Main {
sock = new ServerSocket(i, 50, InetAddress.getLoopbackAddress());
break;
} catch (Exception ignored) {
+ // we couldn't bind to the port, try the next one
}
}
if (sock == null) {
@@ -64,7 +65,7 @@ public class Main {
Socket connection = sock.accept();
Thread t = new SocketThread(connection);
t.start();
- } catch (IOException ignored) {
+ } catch (IOException exception) {
System.exit(0);
}
}
diff --git a/src/main/java/gq/malwarefight/tokenapp/SocketThread.java b/src/main/java/gq/malwarefight/tokenapp/SocketThread.java
index f2d0be7..e0f69dc 100644
--- a/src/main/java/gq/malwarefight/tokenapp/SocketThread.java
+++ b/src/main/java/gq/malwarefight/tokenapp/SocketThread.java
@@ -57,6 +57,8 @@ public class SocketThread extends Thread {
}
}
- } catch (IOException ignored) {}
+ } catch (IOException ignored) {
+ // if something goes wrong, don't worry! just quit immediately
+ }
}
}