Skip to content

Commit

Permalink
fix deadlock issue
Browse files Browse the repository at this point in the history
  • Loading branch information
zyxkad committed Feb 3, 2024
1 parent efc0794 commit 94808a1
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
5 changes: 4 additions & 1 deletion cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,9 +184,12 @@ func (cr *Cluster) Connect(ctx context.Context) bool {
go cr.disconnected()
logErrorf("Disconnected: %v", err)
})
engio.OnMessage(func(_ *engine.Socket, data []byte) {
engio.OnRecv(func(_ *engine.Socket, data []byte) {
logDebugf("Engine.IO recv: %q", (string)(data))
})
engio.OnSend(func(_ *engine.Socket, data []byte) {
logDebugf("Engine.IO sending: %q", (string)(data))
})

cr.socket = socket.NewSocket(engio)
cr.socket.OnConnect(func(*socket.Socket, string) {
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/LiterMC/go-openbmclapi
go 1.21.6

require (
github.com/LiterMC/socket.io v0.0.0-20240203043357-349b916dd92e
github.com/LiterMC/socket.io v0.1.0
github.com/hamba/avro/v2 v2.18.0
github.com/klauspost/compress v1.17.4
gopkg.in/yaml.v3 v3.0.1
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
github.com/LiterMC/socket.io v0.0.0-20240203043357-349b916dd92e h1:tLftcik7JiGMqBAhUm5COZBA3b3UeSTgQsvcujkWFJM=
github.com/LiterMC/socket.io v0.0.0-20240203043357-349b916dd92e/go.mod h1:60lM7+qdBnP64Fk2fB6WmAS6HxI6WCdhlcvaSnutx50=
github.com/LiterMC/socket.io v0.1.0 h1:p3SGNJRKaTldk5Weye1EvKG92l02fLyRgRDmkcLzC7U=
github.com/LiterMC/socket.io v0.1.0/go.mod h1:60lM7+qdBnP64Fk2fB6WmAS6HxI6WCdhlcvaSnutx50=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
Expand Down

0 comments on commit 94808a1

Please sign in to comment.