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

day16:当echo客户端断开连接时,服务器会发生Segmentation fault #74

Open
Ms-1020 opened this issue Dec 25, 2023 · 0 comments

Comments

@Ms-1020
Copy link

Ms-1020 commented Dec 25, 2023

在非阻塞模式下,当某个echo客户端断开连接时,会调用Close函数,进而回调TCPServer中的DeleteConnection函数,导致当前断开连接的客户端的指针被删除。但是在Channel中还会回调Connection中的Business,从而导致空指针异常。

image
此时需要判断当前连接是否已经断开
image

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