Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add full text code remarks #104

Merged
merged 3 commits into from
Aug 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
268 changes: 253 additions & 15 deletions client.go

Large diffs are not rendered by default.

402 changes: 389 additions & 13 deletions compress.go

Large diffs are not rendered by default.

307 changes: 274 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