Skip to content

Commit

Permalink
Improve Counter demo
Browse files Browse the repository at this point in the history
  • Loading branch information
rvassantlal committed Mar 10, 2024
1 parent 687387f commit b2c3a3e
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/main/java/bftsmart/demo/counter/CounterClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,8 @@ public static void main(String[] args) throws IOException {
System.out.println(" default <number of operations> equals 1000");
System.exit(-1);
}

ServiceProxy counterProxy = new ServiceProxy(Integer.parseInt(args[0]));

try {

try (ServiceProxy counterProxy = new ServiceProxy(Integer.parseInt(args[0]))) {
int inc = Integer.parseInt(args[1]);
int numberOfOps = (args.length > 2) ? Integer.parseInt(args[2]) : 1000;

Expand All @@ -63,8 +60,6 @@ public static void main(String[] args) throws IOException {
break;
}
}
} catch(IOException | NumberFormatException e){
counterProxy.close();
}
}
}

0 comments on commit b2c3a3e

Please sign in to comment.