Why Use Net::Server::INET?

For many client-server applications, it is beneficial to have the Perl script acting as the server running and listening to a particular port for client communications. This typically requires the server process to always run. By using Net::Server::INET, the socket management is handled by inetd, and the Perl server program can be run only when a request is made. This has the added advantage of removing on socket handling code (such as the listener, and the call to fork() when a connection is made from a client). All of this is neatly handled by inetd via the module.

Application Example

Perl was selected as the programming language to create a series of servers to run PDF generation routines to be a part of a client-server MRP system. The clients would run applications writing in Progress, thereby prohibiting a more typical web-based client server system and forcing the use of the Progress socket libraries. The PDF generation software being used required the use of Perl on the server-side. Initially the Perl server scripts were written using the Net::Daemon module, which still required that the scripts handle much of the socket connections and request forking. The scripts would also run as independent daemon processes, thus giving the system administrator one more thing to worry about.

In comes Net::Server::INET. Now each of the server scripts did not have to run constantly as separate processes to hear client requests. By simply making a few additions to the services file and inetd.conf, all the socket machinations are handled by inetd via Net::Server::INET.

Usage Code samples

Lightning Talk by brian janaszek (bmj@anklebiter.net)