Skip to content

Conversation

@qkang07
Copy link
Collaborator

@qkang07 qkang07 commented Apr 7, 2024

问题:

因为要优化 socket 连接问题,发现 socket 的抽象不太好。
之前使用了 SocketWrapper 来包装不同平台的 socket 实现。即使是 web 平台也把 WebSocket 包装了一层,完全没有必要。

解决方案:

把 SocketWrapper 抽象为接口,并且和浏览器的 WebSocket API 保持一致。其他平台来适配 WebSocket API,浏览器端保持不变。

其他

抽象了 EventEmitter,有很多地方用到。这次只应用在 MPSocket,其他地方后面再说。

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.

2 participants