From 7a48019d3c9c5dbf4c10d19065d8b790ce71f55d Mon Sep 17 00:00:00 2001 From: Andrew Branson Date: Sat, 18 Jul 2015 08:57:06 +0200 Subject: Support timeout for LDAP connections with LDAP.timeOut property --- src/main/java/com/c2kernel/lookup/LDAPLookup.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/main/java/com/c2kernel/lookup/LDAPLookup.java') diff --git a/src/main/java/com/c2kernel/lookup/LDAPLookup.java b/src/main/java/com/c2kernel/lookup/LDAPLookup.java index 85edc76..28abb24 100644 --- a/src/main/java/com/c2kernel/lookup/LDAPLookup.java +++ b/src/main/java/com/c2kernel/lookup/LDAPLookup.java @@ -92,7 +92,9 @@ public class LDAPLookup * @throws LDAPException when the connection was unsuccessful */ public static LDAPConnection createConnection(LDAPProperties lp) throws LDAPException { - LDAPConnection ld = new LDAPConnection(); + LDAPConnection ld; + if (lp.mTimeOut == 0) ld = new LDAPConnection(); + else ld = new LDAPConnection(lp.mTimeOut); Logger.msg(3, "LDAPLookup - connecting to " + lp.mHost); ld.connect(lp.mHost, Integer.valueOf(lp.mPort).intValue()); -- cgit v1.2.3