Commit e30480fb authored by David Bariod's avatar David Bariod
Browse files

RestHeartbeatService: Add a command line argument to give the name of the interface to use

parent 998716b0
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -61,6 +61,10 @@ public class HeartbeatCollector extends HeartbeatListener {
        super();
    }

    public HeartbeatCollector(String netInterfaceName) throws IOException {
        super(netInterfaceName);
    }
    
    @Override
    public void onMessage(byte[] data) {

+8 −1
Original line number Diff line number Diff line
@@ -53,7 +53,14 @@ public class RestHeartbeatService {
            port = Integer.parseInt(args[0]);
        }

        HeartbeatCollector hbc = new HeartbeatCollector();
        HeartbeatCollector hbc = null;

        if (args.length > 1) {
            hbc = new HeartbeatCollector(args[1]);
        } else {
            hbc = new HeartbeatCollector();
        }
        
        HeartbeatHandler handler = new HeartbeatHandler (hbc);
        
        Server server = new Server(port);