Summary

Concurrent I/O is essential for connection-oriented servers to service multiple clients. Concurrency can also be useful in client code to avoid deadlock situations.

This chapter introduced forking, the most common technique for achieving concurrency. Forking is generally easy to use, but it has a few things to watch for, the most important being the need to wait on exited child processes. It is also common for production servers to detach themselves from the controlling terminal and autobackground themselves. In this chapter we developed a become_daemon() subroutine to do this.

On UNIX systems, the inetd superdaemon provides a simple way to turn ordinary command-line applications into forking servers. You can also use it as a handy way ...

Get Network Programming with Perl now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.