}
writeLine("End of connections.");
} else if (words[0].equalsIgnoreCase("disconnect")) {
- Integer index = Ints.tryParse(words[1]);
- if ((index != null) && (index < lastConnections.size())) {
- core.closeConnection(lastConnections.get(index));
+ if ((words.length == 1) || ("all".equals(words[1]))) {
+ for (Connection connection : lastConnections) {
+ core.closeConnection(connection);
+ }
+ } else {
+ Integer index = Ints.tryParse(words[1]);
+ if ((index != null) && (index < lastConnections.size())) {
+ core.closeConnection(lastConnections.get(index));
+ }
}
}