Home > Net >  Why does gin SocketIO give me EOF errors?
Why does gin SocketIO give me EOF errors?

Time:09-07

Why does gin SocketIO give me EOF errors? gin go-sicketio my code

Server.OnConnect("/", SocketIo.Connect)
....
go func() {
        if err := Server.Serve(); err != nil {
            log.Fatalf("socketio listen error: %s\n", err) // 启动socket.io服务
        }
    }()
defer Server.Close()

err's code

...
2022/09/05 12:18:18 没有找到用户2
2022/09/05 12:18:18 socketio listen error: EOF
....

CodePudding user response:

You may find an answer on page https://github.com/gin-gonic/gin/issues/439

the problem may occurs when you read from the Request Body twice.

  • Related