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

[Enhancement]: 建议给WebSocket添加异常捕获机制或重连次数限制 #217

Closed
xlcodes opened this issue Nov 7, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@xlcodes
Copy link
Contributor

xlcodes commented Nov 7, 2023

建议

目前存在问题:目前Meta2d.js连接websocket暂无连接错误捕获机制,如果用户在图纸传递了异常的ws地址,会导致ws一直重新连接,并且会输出console.info日志。频繁的console有可能会导致内存泄露。
image

建议增加连接异常捕获机制,向外抛出l连接异常消息;或者内置重连次数,由用户控制在重新连接N次后关闭连接。

建议原因

如上处理可以提升用户体验,且减少由于频繁输出日志导致内存泄露。

@xlcodes xlcodes added the enhancement New feature or request label Nov 7, 2023
@ananzhusen
Copy link
Contributor

将在@meta2d/core 1.0.54 版本新增 option->reconnetTimes 配置

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants