Skip to content

Commit 3c03766

Browse files
Merge pull request #14 from divbyzerofordummies/fix-#13
Fixes invalid pipe name under Windows
2 parents 23f5429 + 000adac commit 3c03766

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

ext/PrecompileMQTT.jl

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,15 @@ using MQTTClient
121121
close(server)
122122

123123
## UDS Basic Run
124-
server = MQTTClient.MockMQTTBroker("/tmp/testmqtt.sock")
125-
client, conn = MakeConnection("/tmp/testmqtt.sock")
124+
125+
# Windows requires specific pipe names: https://learn.microsoft.com/de-de/windows/win32/ipc/pipe-names?redirectedfrom=MSDN
126+
tmp_socket_name = if Sys.iswindows()
127+
"\\\\.\\pipe\\tmp\\testmqtt.sock"
128+
else
129+
"/tmp/testmqtt.sock"
130+
end
131+
server = MQTTClient.MockMQTTBroker(tmp_socket_name)
132+
client, conn = MakeConnection(tmp_socket_name)
126133

127134
connect(client, conn)
128135

0 commit comments

Comments
 (0)