if (addresses != null && addresses.size() > 0) {
for (Map.Entry<InetSocketAddress, InetSocketAddress> entry : addresses
.entrySet()) {
final InetSocketAddress mainNodeAddr = entry.getKey();
final InetSocketAddress standbyNodeAddr = entry.getValue();
this.connect(new InetSocketAddressWrapper(mainNodeAddr,
this.serverOrderCount.incrementAndGet(), 1, null));
if (standbyNodeAddr != null) {
this.connect(new InetSocketAddressWrapper(standbyNodeAddr,
this.serverOrderCount.incrementAndGet(), 1,
mainNodeAddr));
}
}
}