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.7k stars 1.04k forks source link

Update connection_unix.go #517

Closed 514366607 closed 11 months ago

514366607 commented 11 months ago

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

yes

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

在AsyncWrite或AsyncWritev的时候,客户端断开后就会出来一个Warn级别的net.ErrClosed错误。还没办法去得掉,应该让调用者在回调时自行处理这个日志。

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

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

4. Checklist

panjf2000 commented 11 months ago

你的描述和代码修改之间并没有关联,这个 PR 里的代码改动也无法达成你的目标,如果你不想打印 net.ErrClosed,可以调用 logging.SetDefaultLoggerAndFlusher 替换成你自己的 logger,然后忽略掉那个错误即可。