Loading kinetic-client/src/main/java/com/seagate/kinetic/monitor/HeartbeatListener.java +26 −3 Original line number Diff line number Diff line Loading @@ -58,6 +58,9 @@ public class HeartbeatListener implements Runnable { private Thread thread = null; // net interface name private String interfaceName = null; /** * Construct a heartbeat consumer with default address and port. * Loading @@ -67,6 +70,19 @@ public class HeartbeatListener implements Runnable { this.init(); } /** * Construct a heartbeat listener with the specified network interface name. * * @param netInterfaceName * @throws IOException */ public HeartbeatListener(String netInterfaceName) throws IOException { this.interfaceName = netInterfaceName; this.init(); } public HeartbeatListener(String address, int port) throws IOException { this.mcastDestination = address; Loading @@ -78,8 +94,14 @@ public class HeartbeatListener implements Runnable { private void init() throws IOException { // find network interface NetworkInterface ni = NetUtil.findMulticastNetworkInterface(); // network interface NetworkInterface ni = null; if (this.interfaceName != null) { ni = NetworkInterface.getByName(interfaceName); } else { ni = NetUtil.findMulticastNetworkInterface(); } // my multicast listening address mcastAddress = InetAddress.getByName(mcastDestination); Loading @@ -89,7 +111,8 @@ public class HeartbeatListener implements Runnable { // only set it if we are allowed to search if (ni != null) { // mcastSocket.setNetworkInterface(ni); logger.info("using network interface: " + ni.getDisplayName()); mcastSocket.setNetworkInterface(ni); } // join the m group Loading Loading
kinetic-client/src/main/java/com/seagate/kinetic/monitor/HeartbeatListener.java +26 −3 Original line number Diff line number Diff line Loading @@ -58,6 +58,9 @@ public class HeartbeatListener implements Runnable { private Thread thread = null; // net interface name private String interfaceName = null; /** * Construct a heartbeat consumer with default address and port. * Loading @@ -67,6 +70,19 @@ public class HeartbeatListener implements Runnable { this.init(); } /** * Construct a heartbeat listener with the specified network interface name. * * @param netInterfaceName * @throws IOException */ public HeartbeatListener(String netInterfaceName) throws IOException { this.interfaceName = netInterfaceName; this.init(); } public HeartbeatListener(String address, int port) throws IOException { this.mcastDestination = address; Loading @@ -78,8 +94,14 @@ public class HeartbeatListener implements Runnable { private void init() throws IOException { // find network interface NetworkInterface ni = NetUtil.findMulticastNetworkInterface(); // network interface NetworkInterface ni = null; if (this.interfaceName != null) { ni = NetworkInterface.getByName(interfaceName); } else { ni = NetUtil.findMulticastNetworkInterface(); } // my multicast listening address mcastAddress = InetAddress.getByName(mcastDestination); Loading @@ -89,7 +111,8 @@ public class HeartbeatListener implements Runnable { // only set it if we are allowed to search if (ni != null) { // mcastSocket.setNetworkInterface(ni); logger.info("using network interface: " + ni.getDisplayName()); mcastSocket.setNetworkInterface(ni); } // join the m group Loading