2 ms·
How common of a pattern is it to accept in a loop but also on a timeout so that you can pre-empt and go do some other work?
by MuffinFlavored 2y ago
How common of a pattern is it to accept in a loop but also on a timeout so that you can pre-empt and go do some other work?
- majewsky 2y agoThe timeout is only a stand-in for the generic need to be able to cancel an acceptance loop. You could just as well want to cancel accept() when SIGINT/SIGTERM/etc is received, or when recreating the server socket, e.g. in response to a configuration change. Most server processes have a need like this.