cloudwego / netpoll

A high-performance non-blocking I/O networking framework focusing on RPC scenarios.
Apache License 2.0
4.07k stars 470 forks source link

ignore onRequest return value is not correct #288

Closed ahfuzhang closed 1 year ago

ahfuzhang commented 1 year ago

see: https://github.com/cloudwego/netpoll/blob/cf96b810bf76819dc2e78f3218d192fe47f99b64/connection_onevent.go#L161

This line ignore the return error of onRequest. I think when use return a error of onRequest, the framework should close socket fd.

Thanks.

joway commented 1 year ago

https://github.com/cloudwego/netpoll/blob/cf96b810bf76819dc2e78f3218d192fe47f99b64/eventloop.go#L93

It should close connection by yourself. currently, netpoll dont use the return error of OnRequest. see the comment.