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

添加对 Connection 的序列化操作 #759

Merged
merged 17 commits into from
May 9, 2022
Merged

Conversation

mouyong
Copy link
Contributor

@mouyong mouyong commented May 2, 2022

tcp

{"id":1,"status":2,"transport":"tcp","getRemoteIp":"127.0.0.1","remotePort":47532,"getRemoteAddress":"127.0.0.1:47532","getLocalIp":"127.0.0.1","getLocalPort":7050,"getLocalAddress":"127.0.0.1:7050","isIpV4":true,"isIpV6":false}

udp

{"transport":"udp","getRemoteIp":"127.0.0.1","remotePort":47532,"getRemoteAddress":"127.0.0.1:47532","getLocalIp":"127.0.0.1","getLocalPort":7050,"getLocalAddress":"127.0.0.1:7050","isIpV4":true,"isIpV6":false}

@walkor
Copy link
Owner

walkor commented May 3, 2022

感谢pr
1、这个不是特别重要的功能,不要新增目录或文件,直接在Connection 和 UdpConnection 里添加方法即可。
2、另外 序列化和反序列化与开发者预期不符,序列化不应该返回json数据,反序列化应该尽可能还原对象,而不是仅仅打印

如果觉得实现Serializable复杂, 只实现 JsonSerializable 即可。

@walkor
Copy link
Owner

walkor commented May 3, 2022

还有个注释统一用英文注释

@mouyong
Copy link
Contributor Author

mouyong commented May 8, 2022

@walkor 倒不是复杂,是2份代码基本一样。这块写两遍吗。

@mouyong
Copy link
Contributor Author

mouyong commented May 8, 2022

反序列化的时候,考虑到进程其实没有关闭,进程的相关信息一直还在。所以没有操作进程数据,那我把序列号和反序列化移除。

@mouyong
Copy link
Contributor Author

mouyong commented May 8, 2022

处理好了

@walkor walkor merged commit b06f1fc into walkor:master May 9, 2022
@walkor
Copy link
Owner

walkor commented May 9, 2022

Thanks

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