fixed issue where registration could beat the check. It is more robust now

This commit is contained in:
nathan 2016-03-02 01:27:48 +01:00
parent 48707e6a73
commit 04bfaf1c70

View File

@ -315,10 +315,12 @@ class Client<C extends Connection> extends EndPointClient<C> implements Connecti
// have to BLOCK
// don't want the client to run before registration is complete
synchronized (this.registrationLock) {
try {
this.registrationLock.wait(connectionTimeout);
} catch (InterruptedException e) {
throw new IOException("Unable to complete registration within '" + connectionTimeout + "' milliseconds", e);
if (!registrationComplete) {
try {
this.registrationLock.wait(connectionTimeout);
} catch (InterruptedException e) {
throw new IOException("Unable to complete registration within '" + connectionTimeout + "' milliseconds", e);
}
}
}