I\'d like to develop a multithreaded UDP server in C/Linux. The service is running on a single port x, thus there\'s only the possibility to bind a single UDP socket to it. In o
As you are only using a single UDP socket, there is no point using epoll - just use a blocking recvfrom instead.
Now, depending on the protocol you need to handle - if you can process each UDP packet individually - you can actually call recvfrom concurrently from multiple threads (in a thread pool). The OS will take care that exactly one thread will receive the UDP packet. This thread can then do whatever it needs to do in handle_request.
However, if you need to process the UDP packets in a particular order, you'll probably not have that many opportunities to parallalise your program...