Inetd

inetd, the super internet daemon, provides a easier way to launch servers. It also helps ease programming, since it feeds any data received to stdin and sends data in stdout of the server, thus making it easier to progam.

Example Server
This is an example for a server using inetd: int main(int argc, char *argv[]) { while(1) { if (getchar) { printf("Hello World!\n"); } } } This server reads anything from stdin (input of client/input of inetd) and sends the message "Hello World!" to the client (stdout of server/output of inetd). It loops using a while statement, to keep the server running.
 * 1) include 

Disabling
Change: INETD=yes to read: INETD=no in /etc/rc.conf. Now, you can reboot, or kill inetd: kill `cat /var/run/inetd.pid` rm /var/run/inetd.pid

Config
You can modify /etc/inetd.conf to configure inetd.