panjf2000 / gnet

🚀 gnet is a high-performance, lightweight, non-blocking, event-driven networking framework written in pure Go.
https://gnet.host
Apache License 2.0
9.69k stars 1.04k forks source link

fixed concurrent map write and read for conn matrix map #633

Closed Wang closed 1 month ago

Wang commented 3 months ago

1. Are you opening this pull request for bug-fixes, optimizations or new feature?

bug fix

2. Please describe how these code changes achieve your intention.

There is a small chance that a connection reading data and writing data at the same time triggers el.close, resulting in concurrent read and write the connMatrix map.

3. Please link to the relevant issues (if any).

fixes #632

4. Which documentation changes (if any) need to be made/updated because of this PR?

4. Checklist

panjf2000 commented 1 month ago

I appreciate your effort here, but this is an incorrect PR.