I use smart fox server. There are two servers on tcp port 9955 and 9956
final Timer timer = new Timer(); timer.scheduleAtFixedRate(new TimerTask() { @Override public void run() { try { appUtils = new AppUtils(ext); conn = ext.getParentZone().getDBManager().getConnection();
nextUpdateTime += resetLeaderboardPeriod * DAY;
Statics.nextVipLeaderBoardUpdate = nextUpdateTime;
int tcpPort = BitSwarmEngine.getInstance().getSocketAcceptor()
.getBoundSockets().get(0).getPort();
if (tcpPort == 9955) {
//here twice
}
} catch (Exception e) {
//...
} finally {
//...
}
The problem is that the block inside if block is called twice. We have two servers one on 9955 and the other on 9956. What is the problem? race condition? thread unsafe?