Skip to content

fix: buffer not send#33

Closed
winking324 wants to merge 6 commits intozishang520:mainfrom
winking324:main
Closed

fix: buffer not send#33
winking324 wants to merge 6 commits intozishang520:mainfrom
winking324:main

Conversation

@winking324
Copy link

@winking324 winking324 commented Jul 21, 2025

  1. 应该在 ready 事件触发时,把 buffer 中的消息继续发送出去,以防止没有新的消息过来,buffer 中的消息也不主动发送
  2. 当其中某一个 packet 发送失败或者出错时,不影响 buffer 中其他 packet 继续发送

fixes zishang520/socket.io#101

* flush buffer on drain

* add some log for debuging

* remove some debug log

* remove the debug logs

* change error log to debug
@zishang520
Copy link
Owner

Well done. I will review it first to ensure it does not cause any new issues.

Copy link
Owner

@zishang520 zishang520 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking forward to your response.

@zishang520
Copy link
Owner

Please hold on while I reassess the new content you submitted.

@winking324
Copy link
Author

Hi, how is the review going? Is there anything else that needs to be revised?

Copy link
Owner

@zishang520 zishang520 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing s.server.Emit("drain", s) and s.Emit("drain") will cause

engine.io/engine/socket.go

Lines 562 to 565 in 52d56d1

s.Once("drain", func(...any) {
socket_log.Debug("all packets have been sent, closing the transport")
s.closeTransport(discard)
})
to fail to execute properly.

@zishang520
Copy link
Owner

This repository and its history have been merged into the Socket.IO monorepo.

@zishang520 zishang520 closed this Aug 22, 2025
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.

向 Room 中广播消息,消息可能会丢失

2 participants