chenshuo / muduo

Event-driven network library for multi-threaded Linux server in C++11
https://github.com/chenshuo/muduo
Other
14.87k stars 5.17k forks source link

Do you have plan to support UDP protocol? How to modify it for UDP in my project ? Thanks! #319

Open kevingwang opened 6 years ago

kevingwang commented 6 years ago

Linux distro and version? x86 or ARM? 32-bit or 64-bit?

Branch (master/cpp11/cpp17) and version of muduo?

Version of cmake, gcc and boost? (If not from distro.)

chenshuo commented 6 years ago

UDP doesn't need a network library, because one UDP socket can talk to multiple peers. For UDP server, you can serve many clients with one UDP socket. (Or use SO_REUSEPORT for better scalability.) For UDP client, you can talk to one or more UDP servers with one UDP socket. A network library has not much to help you here. If you need to integrate UDP with muduo's EventLoop, feel free to use a Channel and set the fd to your UDP socket.

wangwenqiangGitHub commented 3 years ago

如果接收多个udp下发过来的数据,数据量比较大,每个频率在50Hz,如何使用muduo中的线程池处理呢