diff options
| author | 2026-08-21 14:45:59 +0200 | |
|---|---|---|
| committer | 2026-08-21 14:45:59 +0200 | |
| commit | 774e4e463f3c2f31f0991c303e43ca1a84d3fc82 (patch) | |
| tree | d688f51a39ae037055c7b21a09849c769e8487fc /src/main/java/com | |
| parent | 0ef5fdeea29239c0d4bf832cfc9087206b907dbc (diff) | |
Minor refactoring
Diffstat (limited to 'src/main/java/com')
| -rw-r--r-- | src/main/java/com/it_jaros/jns/scan/engine/ScanHostTask.java | 28 |
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); |
