fixed issue where registration could beat the check. It is more robust now
This commit is contained in:
parent
48707e6a73
commit
04bfaf1c70
@ -315,12 +315,14 @@ class Client<C extends Connection> extends EndPointClient<C> implements Connecti
|
|||||||
// have to BLOCK
|
// have to BLOCK
|
||||||
// don't want the client to run before registration is complete
|
// don't want the client to run before registration is complete
|
||||||
synchronized (this.registrationLock) {
|
synchronized (this.registrationLock) {
|
||||||
|
if (!registrationComplete) {
|
||||||
try {
|
try {
|
||||||
this.registrationLock.wait(connectionTimeout);
|
this.registrationLock.wait(connectionTimeout);
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
throw new IOException("Unable to complete registration within '" + connectionTimeout + "' milliseconds", e);
|
throw new IOException("Unable to complete registration within '" + connectionTimeout + "' milliseconds", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
connection = this.connectionManager.getConnection0();
|
connection = this.connectionManager.getConnection0();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user