Skip to content

Commit

Permalink
fix(mqtt): code block
Browse files Browse the repository at this point in the history
  • Loading branch information
xizhibei committed May 11, 2024
1 parent de57fef commit 5823ab5
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions source/_posts/en/mqtt-3-sub-pub-and-topics.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,16 +105,14 @@ Next is publishing and subscribing, below is a very simple example:
os.Exit(1)
}
}
```

```go
{
token := c.Publish("testtopic/123", 0, false, "Hello world")
token.Wait()
}
```

time.Sleep(10 * time.Second)
```


Alternatively, you can also try linking publishing and subscribing as mentioned in the first article, such as sending data on the program and receiving on the desktop client, and vice versa.
Expand Down

0 comments on commit 5823ab5

Please sign in to comment.