Comment #11 on issue 515 by EMMartins: MMS has wrong type of connection ID
http://code.google.com/p/mobicents/issues/detail?id=515
Jean: look at the UID constructor:
public UID() {
synchronized (lock) {
if (!hostUniqueSet) {
hostUnique = (new SecureRandom()).nextInt();
hostUniqueSet = true;
}
unique = hostUnique;
if (lastCount == Short.MAX_VALUE) {
boolean done = false;
while (!done) {
long now = System.currentTimeMillis();
if (now < lastTime + ONE_SECOND) {
// pause for a second to wait for time to change
try {
Thread.currentThread().sleep(ONE_SECOND);
} catch (java.lang.InterruptedException e) {
} // ignore exception
continue;
} else {
lastTime = now;
lastCount = Short.MIN_VALUE;
done = true;
}
}
}
time = lastTime;
count = lastCount++;
}
}
Amit: an AtomicLong which loops when Long.MAX_VALUE, that was how I made
the MGCP
ids, but of course this is not good in a MMS cluster environment where a
client can
interact with multiple nodes at same time...
--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings