Skip to content

Commit

Permalink
Update README example to reflect new listeners API
Browse files Browse the repository at this point in the history
  • Loading branch information
thedevop committed Apr 21, 2024
1 parent 57997ef commit 0140ba0
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ func main() {
_ = server.AddHook(new(auth.AllowHook), nil)

// 在标1883端口上创建一个 TCP 服务端。
tcp := listeners.NewTCP("t1", ":1883", nil)
tcp := listeners.NewTCP(listeners.Config{ID: "t1", Address: ":1883"})
err := server.AddListener(tcp)
if err != nil {
log.Fatal(err)
Expand Down
2 changes: 1 addition & 1 deletion README-JP.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ func main() {
_ = server.AddHook(new(auth.AllowHook), nil)

// Create a TCP listener on a standard port.
tcp := listeners.NewTCP("t1", ":1883", nil)
tcp := listeners.NewTCP(listeners.Config{ID: "t1", Address: ":1883"})
err := server.AddListener(tcp)
if err != nil {
log.Fatal(err)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ func main() {
_ = server.AddHook(new(auth.AllowHook), nil)

// Create a TCP listener on a standard port.
tcp := listeners.NewTCP("t1", ":1883", nil)
tcp := listeners.NewTCP(listeners.Config{ID: "t1", Address: ":1883"})
err := server.AddListener(tcp)
if err != nil {
log.Fatal(err)
Expand Down

0 comments on commit 0140ba0

Please sign in to comment.