希望支持 UDP send/recvmmsg 和 读写 oob #559
IrineSistiana
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
gnet 目前 udp 无法 send/recvmmsg。无法读写 oob。前者可以提高性能,后者能满足一些不常见需求,比如 #416
一个想法是让 gnet 全部处理。比如在 Conn 接口加入 OOB(),MMsg() ,WriteMMsg 等方法。类似 https://pkg.go.dev/golang.org/x/net/ipv6#PacketConn.WriteBatch
或者增加一个 option 叫 NotifyTrafficOnly。如果设置,有 event 时,不进行任何读,而是将 fd 直接传入 OnTraffic。让用户自己去处理这个 event 。这样对 gnet 更改最小,用户的自由度高,但可能导致用户造轮子。
update: 参考
这个项目用 epoll 和 send/recvmmsg 处理 udp: https://github.com/shaoyuan1943/fastudp
Beta Was this translation helpful? Give feedback.
All reactions