Added necessary locking for backend InputsBuffer.

This commit is contained in:
genxium
2022-11-30 16:53:48 +08:00
parent f3a12b2aa9
commit 26370dce61
2 changed files with 79 additions and 48 deletions

View File

@@ -365,7 +365,7 @@ func Serve(c *gin.Context) {
return nil
}
// Tries to receive from client-side in a non-blocking manner.
// TODO: Is there any potential edge-trigger improvement like the epoll approach mentioned above for the following statement? See discussion in https://github.com/gorilla/websocket/issues/122
_, bytes, err := conn.ReadMessage()
if nil != err {
Logger.Error("About to `signalToCloseConnOfThisPlayer`", zap.Any("roomId", pRoom.Id), zap.Any("playerId", playerId), zap.Error(err))