From 774e4e463f3c2f31f0991c303e43ca1a84d3fc82 Mon Sep 17 00:00:00 2001 From: Matthias Jaros Date: Fri, 21 Aug 2026 14:45:59 +0200 Subject: Minor refactoring --- .../com/it_jaros/jns/scan/engine/ScanHostTask.java | 28 +++++++++++----------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'src') 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 { 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 { } } - 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 getPortResult(ProducerState state) { try { return pollPortResult(state); -- cgit v1.3.1