summaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorGravatar Matthias Jaros <jarlucmat@mailbox.org>2026-08-21 14:45:59 +0200
committerGravatar Matthias Jaros <jarlucmat@mailbox.org>2026-08-21 14:45:59 +0200
commit774e4e463f3c2f31f0991c303e43ca1a84d3fc82 (patch)
treed688f51a39ae037055c7b21a09849c769e8487fc /src/main
parent0ef5fdeea29239c0d4bf832cfc9087206b907dbc (diff)
Minor refactoring
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/com/it_jaros/jns/scan/engine/ScanHostTask.java28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/main/java/com/it_jaros/jns/scan/engine/ScanHostTask.java b/src/main/java/com/it_jaros/jns/scan/engine/ScanHostTask.java
index afe0e8e..2ae00d8 100644
--- a/src/main/java/com/it_jaros/jns/scan/engine/ScanHostTask.java
+++ b/src/main/java/com/it_jaros/jns/scan/engine/ScanHostTask.java
@@ -79,6 +79,20 @@ public class ScanHostTask implements Callable<ScanResult> {
return accumulator.build();
}
+ private boolean checkHostOnline() {
+ try {
+ PortResult result = new ScanPortTask(hostAddress, 7, context, hostContext).call();
+ Exception exception = result.getException();
+ if (exception == null && !result.getState().equals(PortState.FILTERED)) {
+ return true;
+ }
+ } catch (Exception e) {
+ // we ignore this error because it means that the host is probably not online
+ }
+
+ return false;
+ }
+
/**
* consumer is the main thread
* we run as long as the producer is running OR
@@ -96,20 +110,6 @@ public class ScanHostTask implements Callable<ScanResult> {
}
}
- private boolean checkHostOnline() {
- try {
- PortResult result = new ScanPortTask(hostAddress, 7, context, hostContext).call();
- Exception exception = result.getException();
- if (exception == null && !result.getState().equals(PortState.FILTERED)) {
- return true;
- }
- } catch (Exception e) {
- // we ignore this error because it means that the host is probably not online
- }
-
- return false;
- }
-
private PollState<PortResult> getPortResult(ProducerState<PortResult> state) {
try {
return pollPortResult(state);