BAEL-5714 : Port Scanning with Java (edit after final review) (#12824)

This commit is contained in:
ACHRAF TAITAI
2022-10-06 14:55:35 +02:00
committed by GitHub
parent 26c89233a1
commit ff4bc93f9d
2 changed files with 2 additions and 2 deletions

View File

@@ -15,7 +15,7 @@ public class PortScanner {
private static final int poolSize = 10;
private static final int timeOut = 200;
public void runPortScan(String ip, int nbrPortMaxToScan) throws IOException, RuntimeException {
public void runPortScan(String ip, int nbrPortMaxToScan) throws IOException {
ConcurrentLinkedQueue openPorts = new ConcurrentLinkedQueue<>();
ExecutorService executorService = Executors.newFixedThreadPool(poolSize);
AtomicInteger port = new AtomicInteger(0);

View File

@@ -11,7 +11,7 @@ class PortScannerUnitTest {
private static final String ip = "127.0.0.1";
PortScanner portScanner = new PortScanner();
@Test public void when_Run_then_lunchPortScan() throws IOException, RuntimeException {
@Test public void when_Run_then_lunchPortScan() throws IOException {
portScanner.runPortScan(ip, nbrPortMax);
}
}