Revision: 17323
Author: vladimir.ralev
Date: Tue Mar 15 03:44:44 2011
Log: Update Issue 2429
Add proposed code for network reachability
http://code.google.com/p/mobicents/source/detail?r=17323

Modified:
/trunk/servers/jain-sip-ha/core/src/main/java/org/mobicents/ha/javax/sip/LoadBalancerHeartBeatingServiceImpl.java

=======================================
--- /trunk/servers/jain-sip-ha/core/src/main/java/org/mobicents/ha/javax/sip/LoadBalancerHeartBeatingServiceImpl.java Sun Dec 5 17:05:09 2010 +++ /trunk/servers/jain-sip-ha/core/src/main/java/org/mobicents/ha/javax/sip/LoadBalancerHeartBeatingServiceImpl.java Tue Mar 15 03:44:44 2011
@@ -486,6 +486,9 @@
Registry registry = LocateRegistry.getRegistry(balancerDescription.getAddress().getHostAddress(), balancerDescription.getRmiPort()); NodeRegisterRMIStub reg=(NodeRegisterRMIStub) registry.lookup("SIPBalancer"); ArrayList<SIPNode> reachableInfo = getReachableSIPNodeInfo(balancerDescription.getAddress(), info);
+                               if(reachableInfo.isEmpty()) {
+                                       logger.logWarning("All connectors are 
unreachable from the balancer");
+                               }

                                reg.handlePing(reachableInfo);
                                balancerDescription.setDisplayWarning(true);
@@ -515,12 +518,16 @@
* @return the list stripped from the nodes not able to reach the load balancer
         */
protected ArrayList<SIPNode> getReachableSIPNodeInfo(InetAddress balancerAddr, ArrayList<SIPNode> info) {
+               if (balancerAddr.isLoopbackAddress()) {
+                       return info;
+               }
+
                ArrayList<SIPNode> rv = new ArrayList<SIPNode>();
                for(SIPNode node: info) {
                        try {
NetworkInterface ni = NetworkInterface.getByInetAddress(InetAddress.getByName(node.getIp()));
                                // FIXME How can I determine the ttl?
-                               boolean b = balancerAddr.isReachable(ni, 5, 
100);
+                               boolean b = balancerAddr.isReachable(ni, 5, 
900);

                                if(b) {
                                        rv.add(node);

Reply via email to