panjf2000 / gnet

🚀 gnet is a high-performance, lightweight, non-blocking, event-driven networking framework written in pure Go.

Home Page:https://gnet.host

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Feature]: enable `OnOpen` when UDP socket is connected

panjf2000 opened this issue · comments

Description of new feature

We currently circumvent the OnOpen callback on the server side, which is fine because UDP requires unconnected sockets on the server side. That being said, we use connected UDP sockets on the client side, and it's feasible to enable OnOpen on the client side.

Scenarios for new feature

For connected UDP sockets.

Breaking changes or not?

No

Code snippets (optional)

No response

Alternatives for new feature

None.

Additional context (optional)

None.

FR: 希望 UDP 的 OnClose 也会被调用。这样UDP和 TCP 的行为统一。

FR: 希望 UDP 的 OnClose 也会被调用。这样UDP和 TCP 的行为统一。

等一下,我记得现在已经是会调用 OnClose 的吧?