summaryrefslogtreecommitdiffstats
path: root/utils/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'utils/src/main/java')
-rw-r--r--utils/src/main/java/org/onap/policy/common/utils/network/NetworkUtil.java5
1 files changed, 2 insertions, 3 deletions
diff --git a/utils/src/main/java/org/onap/policy/common/utils/network/NetworkUtil.java b/utils/src/main/java/org/onap/policy/common/utils/network/NetworkUtil.java
index 3976c7a2..6014b581 100644
--- a/utils/src/main/java/org/onap/policy/common/utils/network/NetworkUtil.java
+++ b/utils/src/main/java/org/onap/policy/common/utils/network/NetworkUtil.java
@@ -21,7 +21,6 @@
package org.onap.policy.common.utils.network;
import java.io.IOException;
-import java.net.ConnectException;
import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.net.ServerSocket;
@@ -132,13 +131,13 @@ public class NetworkUtil {
* @throws InterruptedException if execution has been interrupted
*/
public static boolean isTcpPortOpen(String host, int port, int retries, long interval)
- throws InterruptedException, IOException {
+ throws InterruptedException {
int retry = 0;
while (retry < retries) {
try (Socket s = new Socket(host, port)) {
logger.debug("{}:{} connected - retries={} interval={}", host, port, retries, interval);
return true;
- } catch (final ConnectException e) {
+ } catch (final IOException e) {
retry++;
logger.trace("{}:{} connected - retries={} interval={}", host, port, retries, interval, e);
Thread.sleep(interval);