Skip to content

Commit

Permalink
Add full text code remarks to facilitate learning and research.
Browse files Browse the repository at this point in the history
  • Loading branch information
shengyanli1982 committed Aug 4, 2024
1 parent ebc9ff7 commit 60d8acb
Show file tree
Hide file tree
Showing 15 changed files with 3,080 additions and 266 deletions.
267 changes: 252 additions & 15 deletions client.go

Large diffs are not rendered by default.

297 changes: 264 additions & 33 deletions conn.go

Large diffs are not rendered by default.

16 changes: 13 additions & 3 deletions init.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,17 @@ package gws
import "github.com/lxzan/gws/internal"

var (
framePadding = frameHeader{} // 帧头填充物
binaryPool = internal.NewBufferPool(128, 256*1024) // 缓冲池
defaultLogger = new(stdLogger) // 默认日志工具
// framePadding 用于填充帧头
// framePadding is used to pad the frame header
framePadding = frameHeader{}

// binaryPool 是一个缓冲池,用于管理二进制数据缓冲区
// binaryPool is a buffer pool used to manage binary data buffers
// 参数 128 表示缓冲区的初始大小,256*1024 表示缓冲区的最大大小
// The parameter 128 represents the initial size of the buffer, and 256*1024 represents the maximum size of the buffer
binaryPool = internal.NewBufferPool(128, 256*1024)

// defaultLogger 是默认的日志工具
// defaultLogger is the default logging tool
defaultLogger = new(stdLogger)
)
Loading

0 comments on commit 60d8acb

Please sign in to comment.