Solutions Application Development INETD


The Inetd daemon for Windows servers is the Internet superserver, which invokes Internet server processes as needed. It must be running before other hosts can connect to the local host through services such as ftp, telnet, etc.

The Inetd daemon is designed to invoke the Internet servers as needed, thus reducing load on the system. It is normally started at system boot time. Only one Inetd can run at any given time.

The Inetd daemon starts servers for stream type services. Inetd listens for connection requests on Internet stream sockets. When a connection is requested for one of its sockets, Inetd decides which service the socket will support, it starts then a process, invokes an appropriate server for the connection, and passes the connected socket to the server as stdin and stdout. Thereafter Inetd returns to listening for connection requests.

Advantage

The strength of Inetd for Windows servers is that any character mode program can be started by Inetd and run over winsock. The program does not even have to be network aware. No knowledge of complicated Windows service programming is needed. When Inetd starts a program, it maps the program's standard input, output and error handles to the socket connected to the remote user. With Inetd a program does its I/O using standard C-runtime calls (like scanf(), printf(), etc.) or WIN32 calls (like ReadFile(), WriteFile()); they get redirected over the connected winsock session. Even a simple 'hello world' program can be run via Inetd over winsock.

Network aware programs, which do I/O over a windows socket, need to use the environment variable passed through, Inetd_SOCK, to obtain the socket handle that Inetd creates for connecting the program to a remote user. Inetd sets up this environment variable to the handle of a connected socket for a program. This socket handle is inherited by a program and is already accessible.

Download Inetd version

Click here to download INETD.

 
Subscribe here for our free WEBISO and STARJET
Workshops!