I have a network application on a gateway. It receives and sends packets. For most of them, my gateway acts as a router, but in some cases, it can receive packets too.
Should I have:
- only one main thread
- a main thread + a dispatch thread in charge of giving it to the correct flow handler
- as many threads as there are flows
- something else.