summaryrefslogtreecommitdiffstats
path: root/cadi/client/src
diff options
context:
space:
mode:
Diffstat (limited to 'cadi/client/src')
-rw-r--r--cadi/client/src/main/java/org/onap/aaf/cadi/locator/PropertyLocator.java26
1 files changed, 15 insertions, 11 deletions
diff --git a/cadi/client/src/main/java/org/onap/aaf/cadi/locator/PropertyLocator.java b/cadi/client/src/main/java/org/onap/aaf/cadi/locator/PropertyLocator.java
index 244a43bd..5820bf29 100644
--- a/cadi/client/src/main/java/org/onap/aaf/cadi/locator/PropertyLocator.java
+++ b/cadi/client/src/main/java/org/onap/aaf/cadi/locator/PropertyLocator.java
@@ -193,17 +193,21 @@ public class PropertyLocator implements Locator<URI> {
port = "https".equalsIgnoreCase(o.getScheme())?443:80;
}
socket.connect(new InetSocketAddress(realname,port),3000);
- if(socket.isConnected()) {
- n = new URI(
- o.getScheme(),
- o.getUserInfo(),
- realname,
- o.getPort(),
- o.getPath(),
- o.getQuery(),
- o.getFragment()
- );
- resolve.add(n);
+ try {
+ if(socket.isConnected()) {
+ n = new URI(
+ o.getScheme(),
+ o.getUserInfo(),
+ realname,
+ o.getPort(),
+ o.getPath(),
+ o.getQuery(),
+ o.getFragment()
+ );
+ resolve.add(n);
+ }
+ } finally {
+ socket.close();
}
} catch (IOException e) {
} finally {