Skip to content

[GFX-499] 修复 SocketSender 池化复用导致服务器 callBack null 崩溃 - #13

Merged
AlianBlank merged 1 commit into
mainfrom
feature/GFX-499
Aug 5, 2026
Merged

[GFX-499] 修复 SocketSender 池化复用导致服务器 callBack null 崩溃#13
AlianBlank merged 1 commit into
mainfrom
feature/GFX-499

Conversation

@AlianBlank

@AlianBlank AlianBlank commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator

Linear: GFX-499

Summary by CodeRabbit

  • Bug 修复
    • 优化连接发送资源的生命周期管理,减少重复创建和释放,提升发送稳定性。
    • 修复对象复用时异步回调及用户状态残留问题,降低潜在的异常行为。
  • 性能优化
    • 连接期间复用专用发送资源,减少发送操作的额外开销。

@linear-code

linear-code Bot commented Aug 5, 2026

Copy link
Copy Markdown

GFX-499

@AlianBlank
AlianBlank merged commit 43f9acb into main Aug 5, 2026
2 of 3 checks passed
@AlianBlank
AlianBlank deleted the feature/GFX-499 branch August 5, 2026 13:17
@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 28a98688-3db0-46fc-bf16-0a05a948d690

📥 Commits

Reviewing files that changed from the base of the PR and between 2059f0a and 242090b.

📒 Files selected for processing (2)
  • src/GameFrameX.SuperSocket.Connection/Sockets/SocketSender.cs
  • src/GameFrameX.SuperSocket.Connection/TcpPipeConnection.cs

📝 Walkthrough

Walkthrough

本次修改清理 SocketSender 的异步复用状态,并让 TcpPipeConnection 在连接生命周期内持有单个 SocketSender。连接关闭时,发送器会归还对象池或被释放。

Changes

SocketSender 生命周期管理

Layer / File(s) Summary
SocketSender 状态重置
src/GameFrameX.SuperSocket.Connection/Sockets/SocketSender.cs
TryReset 在对象池复用前清除 _continuationUserToken
连接级发送器管理
src/GameFrameX.SuperSocket.Connection/TcpPipeConnection.cs
TcpPipeConnection 为每个连接持有一个 SocketSender。连接关闭时归还或释放该发送器。SendOverIOAsync() 使用连接级发送器,不再按发送操作获取和清理发送器。

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related issues

  • GameFrameX/GameFrameX.SuperSocket#12:该修改直接覆盖 SocketSender.TryReset 状态清理和 TcpPipeConnection 连接级发送器管理。
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/GFX-499

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant