Skip to content

Commit

Permalink
make it possible to pass IPv6 parameters for the host
Browse files Browse the repository at this point in the history
Signed-off-by: dnazaruk <dmitrii.nazaruk@t-systems.com>
  • Loading branch information
dnazaruk committed Nov 26, 2019
1 parent 1d47b1d commit dec5dea
Showing 1 changed file with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@ public static void main(String[] args) throws Exception {
System.exit(1);
}

String[] hostnamePort = args[0].split(":");
int port;
InetSocketAddress socket;

if (hostnamePort.length == 2) {
port = Integer.parseInt(hostnamePort[1]);
socket = new InetSocketAddress(hostnamePort[0], port);
} else {
port = Integer.parseInt(hostnamePort[0]);
int colonIndex = args[0].lastIndexOf(':');

if (colonIndex < 0) {
int port = Integer.parseInt(args[0]);
socket = new InetSocketAddress(port);
} else {
int port = Integer.parseInt(args[0].substring(colonIndex + 1));
String host = args[0].substring(0, colonIndex);
socket = new InetSocketAddress(host, port);
}

new BuildInfoCollector().register();
Expand Down

0 comments on commit dec5dea

Please sign in to comment.