go-socket.io icon indicating copy to clipboard operation
go-socket.io copied to clipboard

Use `redis.Pool` to send messages.

Open Degfy opened this issue 2 years ago • 1 comments

  1. I changed the publish message in redisBroadcast from redis.PubSubConn to redis.Pool because I found that sometimes “Use of closed network connection” would appear when publishing and never recover.

  2. Additionally, I added a special event “ping” to sense the browser’s ping. Here’s an example of how to use it:

SocketServer.OnEvent(model.NameSpace, "ping", func(io IO.Conn) {//todo}

Degfy avatar Apr 07 '23 03:04 Degfy

@Degfy loving the fix here. Are you able to rebase this branch on master? Also, you introduced the dep "logrus". There is a logging library already being used. You can check it out here: https://github.com/googollee/go-socket.io/pull/610 Once that's fixed i'll be happy to merge

erkie avatar Aug 21 '23 11:08 erkie