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

正确的关闭client Socket #189

Open
firebook opened this issue Feb 5, 2021 · 0 comments
Open

正确的关闭client Socket #189

firebook opened this issue Feb 5, 2021 · 0 comments

Comments

@firebook
Copy link

firebook commented Feb 5, 2021

期待加个类,正确的关闭client Socket

直接调用java.net.Socket#close(),会导致服务端报:java.net.SocketException: Connection reset

原因是close会先发FIN,再发RST,客户端没有等待服务端的FIN

相关链接:https://docs.oracle.com/javase/8/docs/technotes/guides/net/articles/connection_release.html

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

No branches or pull requests

1 participant