diff options
Diffstat (limited to 'src')
| -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); |
