Main Page | Modules | Class Hierarchy | Class List | File List | Class Members | Related Pages

using a superserver

Table Of Contents

definition of the superserver technology

this sounds a little bit mystic or even more dangerous but it's a very old story on UNIX like operating systems and well known under his name inetd or his new brother xinetd. inetd and xinetd were developed to solve a general problem that a large amount of server like applications have a common feature for listen and wait for incoming connections. The superserver technology was born to pull the common listen and wait for incoming connections part into a separate piece of code with an additional customization feature to link a specific port to an executable for handling the connections. The customization is done in a specific file like /etc/inetd.conf (e.g. for inetd) with a very simple syntax:

 # <service_name> <sock_type> <proto> <flags> <user> <server_path>  <args>
   ftp            stream      tcp     nowait  root   /usr/sbin/tcpd in.ftpd

Link between the superserver technology and 'Freiburg'

libFreiburg 2.0 supports 2 socket domains of type SOCK_STREAM: Every domain can be used in local ore remote mode: only the remote feature will be discussed in this paper.

To use the remote mode the client and the server are started with the -inetd command-line argument:

In addition to the -inetd command-line option the client need additional options to identify the remote socket address:

Examples for using the superserver technology with 'Freiburg'

both examples using the inetd superserver, with the corresponding /etc/inetd.conf configuration file, to start a libFreiburg 2.0 service.
  1. start a libFreiburg 2.0 server with inet domain:
    ## superserver is listen on 'inet' port 'myPort' for incoming connections and
    ## starting 'FreiburgServer' with user 'myuser'
    myPort stream tcp nowait myuser /path/to/FreiburgServer FreiburgServer -inetd -tcp
    
  2. start a libFreiburg 2.0 server with unix domain:
    ## superserver is listen on 'unix' file '/var/myFile' for incoming connections and
    ## starting 'FreiburgServer' with user 'myuser'
    /var/myFile stream unix nowait myuser /path/to/FreiburgServer FreiburgServer -inetd -uds
    
attention: not every inetd superserver supporting the unix domain.

prev: create a snmp service - top: libFreiburg 2.0 - next: using threads

Generated on Tue Nov 23 16:13:06 2004 for libFreiburg by  doxygen 1.3.8-20040928