Skip to content

Commit 0e6df8c

Browse files
committed
Use - instead of _ in auto clientid
1 parent 0b8f25d commit 0e6df8c

2 files changed

Lines changed: 2 additions & 3 deletions

File tree

src/nmqtt_pub.nim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ include "nmqtt.nim"
66

77
proc nmqttPub(host="127.0.0.1", port: int=1883, ssl:bool=false, clientid="", username="", password="", topic, msg: string, qos=0, retain=false, repeat=0, repeatdelay=0, willtopic="", willmsg="", willqos=0, willretain=false, verbose=false) =
88
## CLI tool for publish
9-
let ctx = newMqttCtx(if clientid != "": clientid else: "nmqtt_pub_" & $getCurrentProcessId())
9+
let ctx = newMqttCtx(if clientid != "": clientid else: "nmqttpub-" & $getCurrentProcessId())
1010
ctx.set_host(host, port, ssl)
1111

1212
if username != "" or password != "":

src/nmqtt_sub.nim

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@ proc handler() {.noconv.} =
1515

1616
proc nmqttSub(host="127.0.0.1", port: int=1883, ssl:bool=false, clientid="", username="", password="", topic: string, qos=0, keepalive=60, removeretained=false, willtopic="", willmsg="", willqos=0, willretain=false, verbose=false) {.async.} =
1717
## CLI tool for subscribe
18-
if clientid != "":
19-
ctx.clientId = clientid
18+
let ctx = newMqttCtx(if clientid != "": clientid else: "nmqttsub-" & $getCurrentProcessId())
2019

2120
if port == 8883:
2221
ctx.set_host(host, port, true)

0 commit comments

Comments
 (0)