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

在 SuperSocket.WebSocket 2.0 中,如何在 IPackageMapper 中处理包未能够完整接收情况 #759

Open
freefer opened this issue Nov 4, 2024 · 7 comments
Assignees
Labels
2.0 SuperSocket 2.0 question

Comments

@freefer
Copy link

freefer commented Nov 4, 2024

在unity andorid 环境下使用WebSocket4Ne4连接WebSocketServer ,客户都使用data发送数据例如[byte,int,long,imgdata]
image

在服务端处理IPackageMapper<WebSocketPackage, YoloPackage>
image
image

出现图片数据包有时候未能完整接收 我改如何返回或处理这种情况并等待包接收完成

@kerryjiang kerryjiang added question 2.0 SuperSocket 2.0 labels Nov 6, 2024
@kerryjiang kerryjiang self-assigned this Nov 6, 2024
@kerryjiang
Copy link
Owner

这错误是WebSocket客户端发送的数据没有mask, 这是老版本客户端的问题。升级一下WebSocket4Net.

@freefer
Copy link
Author

freefer commented Nov 15, 2024

使用的版本是0.15.2 最新稳定版,运行一段时间是正确的工作,服务端和客户端数据收发正常。在andorid 低功耗情况下偶尔出现,调试收到包不完整 图片不是预期完整数据

@kerryjiang
Copy link
Owner

服务器端最近刚刚升级了?

@freefer
Copy link
Author

freefer commented Nov 20, 2024

服务器端最近刚刚升级了?

SuperSocket.WebSocket.Server 2.0.0-beta.28
image

@kerryjiang
Copy link
Owner

能确定客户端的ip和类型吗?出现不是很频繁是吧?

@freefer
Copy link
Author

freefer commented Nov 22, 2024

能确定客户端的ip和类型吗?出现不是很频繁是吧?

目前测试一个安卓客户端IPV4 WIFI连接局域网情况下, 在获取摄像头流中每隔10帧发送一次640*640图片数据
image
image
image
目前能正常运行一段时间 偶尔会出现异常,调试异常是图片无法得到完整数据在byte[]转换jpg抛出,是否丢包现象。

@freefer
Copy link
Author

freefer commented Dec 23, 2024

尝试不做 frameCount % 5 == 0 跳帧发送 ,服务端在正常接收几轮数据后出现SuperSocket.ProtoBase.ProtocolException: Mask is required for this websocket package.
服务端断开连接 未捕获任何异常

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

No branches or pull requests

2 participants