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

连接reset的时候会出现崩溃 #3

Open
fruitbars opened this issue Apr 24, 2024 · 0 comments
Open

连接reset的时候会出现崩溃 #3

fruitbars opened this issue Apr 24, 2024 · 0 comments

Comments

@fruitbars
Copy link

对应的代码应该在这:
chat.go中

_, msg, err := conn.ReadMessage()
if err != nil {
fmt.Println("read message error:", err)
break
}

报错和崩溃信息:
2024/04/24 17:00:24 read tcp 10.1.194.5:63162->114.118.65.75:443: read: connection reset by peer
read message error: read tcp 10.1.194.5:63153->114.118.65.75:443: read: connection reset by peer
read message error: read tcp 10.1.194.5:63147->114.118.65.75:443: read: connection reset by peer
read message error: read tcp 10.1.194.5:63161->114.118.65.75:443: read: connection reset by peer
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x18 pc=0x100953110]

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