Skip to content

Commit 87e570b

Browse files
author
Ian Craggs
committed
Change sample for Java <1.9
1 parent 831a69d commit 87e570b

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

org.eclipse.paho.sample.mqttclient/src/main/java/org/eclipse/paho/sample/mqttclient/mqttv3/MqttV3Connection.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public MqttV3Connection(CommandLine cliOptions) throws URISyntaxException {
7171
// If the client ID was not set, generate one ourselves
7272
if (clientID == null || clientID == "") {
7373
// No client ID provided, generate one from the process ID
74-
long pid = ProcessHandle.current().pid();
74+
long pid = Thread.currentThread().getId(); //ProcessHandle.current().pid();
7575
clientID = "mqtt-client-" + pid;
7676
}
7777

org.eclipse.paho.sample.mqttclient/src/main/java/org/eclipse/paho/sample/mqttclient/mqttv5/MqttV5Connection.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public MqttV5Connection(CommandLine cliOptions) {
7272
// If the client ID was not set, generate one ourselves
7373
if (clientID == null || clientID == "") {
7474
// No client ID provided, generate one from the process ID
75-
long pid = ProcessHandle.current().pid();
75+
long pid = Thread.currentThread().getId(); //ProcessHandle.current().pid();
7676
clientID = "mqtt-client-" + pid;
7777
}
7878

0 commit comments

Comments
 (0)