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

websocket在大量连接下发送数据遇到一个BUG #698

Open
x0gundam1133 opened this issue Mar 1, 2024 · 3 comments
Open

websocket在大量连接下发送数据遇到一个BUG #698

x0gundam1133 opened this issue Mar 1, 2024 · 3 comments
Assignees
Labels
2.0 SuperSocket 2.0 bug

Comments

@x0gundam1133
Copy link

x0gundam1133 commented Mar 1, 2024

外网大量用户连接,每天大概触发2-3次,找不到规律
内网大量连接发送测试没重现
看错误是websocket连接过程中握手发送消息错误
版本2.0 beta18

2024-03-01 11:15:27,765 [.NET ThreadPool Worker] ERROR SuperSocketService - Session[02e35048-d60a-49e7-8aa9-7b19e44669ad]: session exception.
SuperSocket.PackageHandlingException1[SuperSocket.WebSocket.WebSocketPackage]: Session 02e35048-d60a-49e7-8aa9-7b19e44669ad got an error when handle a package. ---> System.InvalidOperationException: Writing is not allowed after writer was completed. at System.IO.Pipelines.ThrowHelper.ThrowInvalidOperationException_NoWritingAllowed() at System.IO.Pipelines.Pipe.DefaultPipeWriter.GetSpan(Int32 sizeHint) at SuperSocket.ProtoBase.Extensions.Write(IBufferWriter1 writer, ReadOnlySpan1 text, Encoding encoding) at SuperSocket.WebSocket.Server.WebSocketPackageHandler.<>c__DisplayClass17_0.<HandleHandshake>b__0(PipeWriter writer) at SuperSocket.Channel.PipeChannel1.SendAsync(Action1 write) at SuperSocket.WebSocket.Server.WebSocketPackageHandler.HandleHandshake(IAppSession session, WebSocketPackage p) at SuperSocket.WebSocket.Server.WebSocketPackageHandler.Handle(IAppSession session, WebSocketPackage package) at SuperSocket.Server.PackageHandlingSchedulerBase1.HandlePackageInternal(IAppSession session, TPackageInfo package)
--- End of inner exception stack trace ---

@kerryjiang kerryjiang self-assigned this Mar 17, 2024
@kerryjiang kerryjiang added 2.0 SuperSocket 2.0 bug labels Mar 17, 2024
@loveyeguo
Copy link

我也遇到了同样的错误,像客户端发送报文时偶尔会出错:

****************************异常文本**************************** 【出现时间】:2024/7/15 14:09:43 【异常类型】:InvalidOperationException 【异常信息】:Writing is not allowed after writer was completed. 【堆栈调用】: at System.IO.Pipelines.ThrowHelper.ThrowInvalidOperationException_NoWritingAllowed() at System.IO.Pipelines.Pipe.DefaultPipeWriter.GetSpan(Int32 sizeHint) at SuperSocket.Channel.PipeChannel1.WriteBuffer(PipeWriter writer, ReadOnlyMemory1 buffer) in D:\coding\夏工\code\SuperSocket-master\src\SuperSocket.Channel\PipeChannel.cs:line 335 at SuperSocket.Channel.PipeChannel1.SendAsync(ReadOnlyMemory1 buffer) in D:\coding\夏工\code\SuperSocket-master\src\SuperSocket.Channel\PipeChannel.cs:line 323 at AcquisitionPlatform.Command_Heart.Execute(MyAppSession session, StringPackageInfo package) in D:\coding\夏工\code\SuperSocket-master\AcquisitionPlatform\Command\Command_Heart.cs:line 47 ***************************************************************

@kerryjiang
Copy link
Owner

It looks like something was being sent but the connection dropped.

@kerryjiang
Copy link
Owner

Released SuperSocket 2.0.0-beta.27 to fix this issue:
https://www.nuget.org/packages/SuperSocket/2.0.0-beta.27

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.0 SuperSocket 2.0 bug
Projects
None yet
Development

No branches or pull requests

3 participants