<?xml version="1.0" encoding="UTF-8"?>

<!-- ====================================================================== -->
<!-- = appendix-i.xml                                                     = -->
<!-- = standard network module guide - appendix i                         = -->
<!-- ====================================================================== -->
<!-- = This  program  is  free  software; you  can redistribute it and/or = -->
<!-- = modify it provided that this copyright notice is kept intact.      = -->
<!-- = This program is distributed in the hope that it will be useful but = -->
<!-- = without  any  warranty;  without  even  the  implied  warranty  of = -->
<!-- = merchantability or fitness for  a  particular purpose. In no event = -->
<!-- = shall  the  copyright  holder be liable for any  direct, indirect, = -->
<!-- = incidental  or special  damages arising  in any way out of the use = -->
<!-- = of this software.                                                  = -->
<!-- ====================================================================== -->
<!-- = copyright (c) 2005-2007 - amaury darsch                            = -->
<!-- ====================================================================== -->

<appendix module="net" number="i">
  <title>Networking reference</title>

  <p>
  This appendix is a reference of the <afnix/> standard networking
  module.
  </p>

  <table>
    <title>Standard networking module</title>
    <thead>
      <tr><td>Symbol</td> <td>Description</td></tr>
    </thead>
    <tbody>
      <tr><td>afnix-net</td><td>module</td></tr>
      <tr><td>afnix:net</td><td>nameset</td></tr>
    </tbody>
  </table>

  <!-- =================================================================== -->
  <!-- = address object                                                  = -->
  <!-- =================================================================== -->

  <object nameset="afnix:net">
    <name>Address</name>

    <!-- synopsis -->
    <p>
    The <code>Address</code> class is the Internet address manipulation
    class. The class can be used to perform the conversion between a
    host name and an IP address. The opposite is also possible. Finally,
    the class supports both IP version 4 and IP version 6 address
    formats.
    </p>

    <!-- predicate -->
    <pred>address-p</pred>

    <!-- inheritance -->
    <inherit>
      <name>Object</name>
    </inherit>

    <!-- constructor -->
    <ctor>
      <name>Address</name>
      <args>String</args>
      <p>
      The <code>Address</code> constructor create an IP address object
      by name. The name argument is a string of a host name or a valid
      IP address representation.
      </p>
    </ctor>

    <!-- methods -->
    <method>
      <name>get-name</name>
      <retn>String</retn>
      <args>none</args>
      <p>
      The <code>get-name</code> method returns the original name used
      during the object construction.
      </p>
    </method>

    <method>
      <name>get-address</name>
      <retn>String</retn>
      <args>none</args>
      <p>
      The <code>get-address</code> method returns a string
      representation of the IP address. The string representation 
      follows the IP version 4 or IP version 6 preferred formats,
      depending on the internal representation.
      </p>
    </method>

    <method>
      <name>get-vector</name>
      <retn>Vector</retn>
      <args>none</args>
      <p>
      The <code>get-vector</code> method returns a vector
      representation of the IP address. The vector result follows the
      IP version 4 or IP version 6 preferred format, depending on the
      internal representation.
      </p>
    </method>

    <method>
      <name>get-canonical-name</name>
      <retn>String</retn>
      <args>none</args>
      <p>
      The <code>get-canonical-name</code> method returns a fully
      qualified name of the address. The resulting name is obtained by
      performing a reverse lookup. Note that the name can be different
      from the original name.
      </p>
    </method>

    <method>
      <name>get-alias-size</name>
      <retn>Integer</retn>
      <args>none</args>
      <p>
      The <code>get-alias-size</code> method returns the number of
      aliases for the address. The number of aliases includes as well
      the primary resolved name which is located at index 0.
      </p>
    </method>

    <method>
      <name>get-alias-name</name>
      <retn>String</retn>
      <args>Integer</args>
      <p>
      The <code>get-alias-name</code> method returns a fully
      qualified name of the address alias by index. The first argument
      is the alias index number which must be in the alias index
      range. The resulting name is obtained by performing a reverse
      lookup. Note that the name can be different from the original
      name. Using index 0 is equivalent to call
      <code>get-canonical-name</code>.
      </p>
    </method>

    <method>
      <name>get-alias-address</name>
      <retn>String</retn>
      <args>Integer</args>
      <p>
      The <code>get-alias-address</code> method returns a string
      representation of the IP address alias by index. The first argument
      is the alias index number which must be in the alias index
      range. The string representation follows the IP version 4 or IP
      version 6 preferred formats, depending on the internal
      representation. Using index 0 is equivalent to call
      <code>get-address</code>.
      </p>
    </method>

    <method>
      <name>get-alias-vector</name>
      <retn>Vector</retn>
      <args>Integer</args>
      <p>
      The <code>get-alias-vector</code> method returns a vector
      representation of the IP address alias by index. The first
      argument is the alias index number which must be in the alias
      index range. The vector result follows the IP version 4 or IP
      version 6 preferred format, depending on the internal
      representation. Using index 0 is equivalent to call
      <code>get-vector</code>.
      </p>
    </method>
  </object>

  <!-- =================================================================== -->
  <!-- = socket object                                                   = -->
  <!-- =================================================================== -->
  
  <object nameset="afnix:net">
    <name>Socket</name>

    <!-- synopsis -->
    <p> 
    The <code>Socket</code> class is a base class for the <afnix/>
    network services. The class is automatically constructed by a
    derived class and provide some common methods for all socket
    objects.
    </p>

    <!-- predicate -->
    <pred>socket-p</pred>

    <!-- inheritance -->
    <inherit>
      <name>Input</name>
      <name>Output</name>
    </inherit>

    <!-- constants -->
    <constant>
      <name>REUSE-ADDRESS</name>
      <p>
      The <code>REUSE-ADDRESS</code> constant is used by the
      <code>set-option</code> method to enable socket address
      reuse. This option changes the rules that validates the address
      used by bind. It is not recommended to use that option as it
      decreases TCP reliability.
      </p>
    </constant>

    <constant>
      <name>BROADCAST</name>
      <p>
      The <code>BROADCAST</code> constant is used by the
      <code>set-option</code> method to enable broadcast of
      packets. This options only works with IP version 4 address. The
      argument is a boolean flag only. 
      </p>
    </constant>

    <constant>
      <name>DONT-ROUTE</name>
      <p>
      The <code>DONT-ROUTE</code> constant is used by the
      <code>set-option</code> method to control if a packet is to be
      sent via the routing table. This option is rarely used with
      <afnix/>. The argument is a boolean flag only. 
      </p>
    </constant>

    <constant>
      <name>KEEP-ALIVE</name>
      <p>
      The <code>KEEP-ALIVE</code> constant is used by the
      <code>set-option</code> method to check periodically if the
      connection is still alive. This option is rarely used with
      <afnix/>. The argument is a boolean flag only. 
      </p>
    </constant>

    <constant>
      <name>LINGER</name>
      <p>
      The <code>LINGER</code> constant is used by the
      <code>set-option</code> method to turn on or off the lingering
      on close. If the first argument is true, the second argument is
      the linger time.
      </p>
    </constant>

    <constant>
      <name>RCV-SIZE</name>
      <p>
      The <code>RCV-SIZE</code> constant is used by the
      <code>set-option</code> method to set the receive buffer size. 
      </p>
    </constant>

    <constant>
      <name>SND-SIZE</name>
      <p>
      The <code>SND-SIZE</code> constant is used by the
      <code>set-option</code> method to set the send buffer size.
      </p>
    </constant>

    <constant>
      <name>HOP-LIMIT</name>
      <p>
      The <code>HOP-LIMIT</code> constant is used by the
      <code>set-option</code> method to set packet hop limit.
      </p>
    </constant>

    <constant>
      <name>MULTICAST-LOOPBACK</name>
      <p>
      The <code>MULTICAST-LOOPBACK</code> constant is used by the
      <code>set-option</code> method to control whether or not
      multicast packets are copied to the loopback. The argument is a
      boolean flag only.
      </p>
    </constant>

    <constant>
      <name>MULTICAST-HOP-LIMIT</name>
      <p>
      The <code>MULTICAST-HOP-LIMIT</code> constant is used by the
      <code>set-option</code> method to set the hop limit for
      multicast packets.
      </p>
    </constant>

    <constant>
      <name>MAX-SEGMENT-SIZE</name>
      <p>
      The <code>MAX-SEGMENT-SIZE</code> constant is used by the
      <code>set-option</code> method to set the TCP maximum segment size.
      </p>
    </constant>

    <constant>
      <name>NO-DELAY</name>
      <p>
      The <code>NO-DELAY</code> constant is used by the
      <code>set-option</code> method to enable or disable the Naggle
      algorithm.
      </p>
    </constant>

    <!-- methods -->
    <method>
      <name>bind</name>
      <retn>none</retn>
      <args>Integer</args>
      <p>
      The <code>bind</code> method binds this socket to the port
      specified as the argument.
      </p>
    </method>

    <method>
      <name>bind</name>
      <retn>none</retn>
      <args>Integer Address</args>
      <p>
      The <code>bind</code> method binds this socket to the port
      specified as the first argument and the address specified as the
      second argument.
      </p>
    </method>

    <method>
      <name>connect</name>
      <retn>none</retn>
      <args>Integer Address [Boolean]</args>
      <p>
      The <code>connect</code> method connects this socket to the port
      specified as the first argument and the address specified as the
      second argument. A connected socket is useful with udp client
      that talks only with one fixed server. The optional third
      argument is a boolean flag that permits to select whether or not
      the alias addressing scheme should be used. If the flag is false,
      the default address is used. If the flag is true, an attempt is
      made to connect to the first successful address that is part
      of the alias list.
      </p>
    </method>

    <method>
      <name>open-p</name>
      <retn>Boolean</retn>
      <args>none</args>
      <p>
      The <code>open-p</code> predicate returns true if the socket is
      open. The method checks that a descriptor is attached to the
      object. This does not mean that the descriptor is valid in the
      sense that one can read or write on it. This method is useful to
      check if a socket has not been closed.
      </p>
    </method>

    <method>
      <name>shutdown</name>
      <retn>Boolean</retn>
      <args>none|Boolean</args>
      <p>
      The <code>shutdown</code> method shutdowns or close the
      connection. Without argument, the connection is closed without
      consideration for those symbols attached to the object. With one
      argument, the connection is closed in one direction only. If the
      mode argument is false, further receive is disallowed. If the
      mode argument is true, further send is disallowed. The method
      returns true on success, false otherwise.
      </p>
    </method>

    <method>
      <name>ipv6-p</name>
      <retn>Boolean</retn>
      <args>none</args>
      <p>
      The <code>ipv6-p</code> predicate returns true if the socket
      address is an IP version 6 address, false otherwise.
      </p>
    </method>

    <method>
      <name>read</name>
      <retn>Character</retn>
      <args>none</args>
      <p>
      The <code>read</code> method returns the next character
      available from the socket. If the socket has been closed, the
      <code>eof</code> character is returned.
      </p>
    </method>
      
    <method>
      <name>read</name>
      <retn>Buffer</retn>
      <args>Integer</args>
      <p>
      The <code>read</code> method with an integer argument returns a
      buffer of characters by reading the socket. The number of read
      characters might be less than requested. Use the <code>length</code>
      method to check for the returned buffer size.
      </p>
    </method>

    <method>
      <name>readln</name>
      <retn>String</retn>
      <args>none</args>
      <p>
      The <code>readln</code> method returns the next line available
      from the socket. If the socket has been closed, the <code>eof</code>
      character is returned.
      </p>
    </method>

    <method>
      <name>write</name>
      <retn>none</retn>
      <args>Literal+</args>
      <p>
      The <code>write</code> method write one or more literal
      arguments on the socket. This method returns nil.
      </p>
    </method>

    <method>
      <name>writeln</name>
      <retn>none</retn>
      <args>Literal</args>
      <p>
      The <code>writeln</code> method write one or more literal
      argument to the socket and finish with a newline. This method
      return nil.
      </p>
    </method>

    <method>
      <name>newline</name>
      <retn>none</retn>
      <args>none</args>
      <p>
      The <code>newline</code> method writes a new line character to
      the socket. The method returns nil.
      </p>
    </method>

    <method>
      <name>close</name>
      <retn>Boolean</retn>
      <args>none</args>
      <p>
      The <code>close</code> method close the socket and returns true
      on success, false otherwise. In case of success, multiple calls
      return true.
      </p>
    </method>

    <method>
      <name>valid-p</name>
      <retn>Boolean</retn>
      <args>none|Integer</args>
      <p>
      The <code>valid-p</code> method returns true if the socket is in
      a valid state. By valid state, we mean that the socket can read
      a character. With one argument, the method timeout after the
      specified time.
      </p>
    </method>

    <method>
      <name>eof-p</name>
      <retn>Boolean</retn>
      <args>none</args>
      <p>
      The <code>eof-p</code> method returns true if no more characters
      can be read from this socket or the socket has been closed.
      </p>
    </method>

    <method>
      <name>pushback</name>
      <retn>none</retn>
      <args>Character|String</args>
      <p>
      The <code>pushback</code> method pushback a character or a
      string in the input stream. Subsequent calls to read will return
      the last pushed characters. Pushing a string is equivalent to
      push each characters of the string.
      </p>
    </method>

    <method>
      <name>get-socket-address</name>
      <retn>Address</retn>
      <args>none</args>
      <p>
      The <code>get-socket-address</code> method returns an address
      object of the socket. The returned object can be later used to
      query the canonical name and the ip address.
      </p>
    </method>

    <method>
      <name>get-socket-port</name>
      <retn>Integer</retn>
      <args>none</args>
      <p>
      The <code>get-socket-address</code> method returns the port
      number of the socket.
      </p>
    </method>

    <method>
      <name>get-peer-address</name>
      <retn>Address</retn>
      <args>none</args>
      <p>
      The <code>get-peer-address</code> method returns an address
      object of the socket's peer. The returned object can be later
      used to query the canonical name and the ip address.
      </p>
    </method>

    <method>
      <name>get-peer-port</name>
      <retn>Integer</retn>
      <args>none</args>
      <p>
      The <code>get-socket-address</code> method returns the port
      number of the socket's peer.
      </p>
    </method>

    <method>
      <name>set-option</name>
      <retn>Boolean</retn>
      <args>constant [Boolean|Integer] [Integer]</args>
      <p>
      The <code>set-option</code> method set a socket option. The
      first argument is the option to set. The second argument is a
      boolean value which turn on or off the option. The optional
      third argument is an integer needed for some options.
      </p>
    </method>
  </object>

  <!-- =================================================================== -->
  <!-- = tcp socket object                                               = -->
  <!-- =================================================================== -->
  
  <object nameset="afnix:net">
    <name>TcpSocket</name>

    <!-- synopsis -->
    <p>
    The <code>TcpSocket</code> class is a base class for all tcp
    socket objects. The class is derived from the <code>Socket</code>
    class and provides some specific tcp methods. If a
    <code>TcpSocket</code> is created, the user is responsible to
    connect it to the proper address and port.
    </p>

    <!-- predicate -->
    <pred>tcp-socket-p</pred>

    <!-- inheritance -->
    <inherit>
      <name>Socket</name>
    </inherit>

    <!-- constructors -->
    <ctor>
      <name>TcpSocket</name>
      <args>none</args>
      <p>
      The <code>TcpSocket</code> constructor creates a new tcp socket.
      </p>
    </ctor>

    <!-- methods -->
    <method>
      <name>accept</name>
      <retn>TcpSocket</retn>
      <args>none</args>
      <p>
      The <code>accept</code> method waits for incoming connection and
      returns a <code>TcpSocket</code> object initialized with the
      connected peer. The result socket can be used to perform i/o
      operations. This method is used by tcp server.
      </p>
    </method>

    <method>
      <name>listen</name>
      <retn>Boolean</retn>
      <args>none|Integer</args>
      <p>
      The <code>listen</code> method initialize a socket to accept
      incoming connection. Without argument, the default number of
      incoming connection is 5. The integer argument can be used to
      specify the number of incoming connection that socket is willing
      to queue. This method is used by tcp server.
      </p>
    </method>
  </object>

  <!-- =================================================================== -->
  <!-- = tcp client object                                               = -->
  <!-- =================================================================== -->
  
  <object nameset="afnix:net">
    <name>TcpClient</name>

    <!-- synopsis -->
    <p>
    The <code>TcpClient</code> class creates a tcp client by host and
    port. The host argument can be either a name or an address
    object. The port argument is the server port to contact. The
    <code>TcpClient</code> class is derived from the
    <code>TcpSocket</code> class. This class has no specific methods.
    </p>

    <!-- predicate -->
    <pred>tcp-client-p</pred>

    <!-- inheritance -->
    <inherit>
      <name>TcpSocket</name>
    </inherit>

    <!-- constructors -->
    <ctor>
      <name>TcpClient</name>
      <args>String Integer</args>
      <p>
      The <code>TcpClient</code> constructor creates a new tcp client
      socket by host name and port number.
      </p>
    </ctor>
  </object>
    
  <!-- =================================================================== -->
  <!-- = tcp server object                                               = -->
  <!-- =================================================================== -->
  
  <object nameset="afnix:net">
    <name>TcpServer</name>

    <!-- synopsis -->
    <p>
    The <code>TcpServer</code> class creates a tcp server by port. An
    optional host argument can be either a name or an address
    object. The port argument is the server port to bind. The
    <code>TcpServer</code> class is derived from the
    <code>TcpSocket</code> class. This class has no specific
    methods. With one argument, the server bind the port argument on
    the local host. The backlog can be specified as the last
    argument. The host name can also be specified as the first
    argument, the port as second argument and eventually the
    backlog. Note that the host can be either a string or an address
    object.
    </p>

    <!-- predicate -->
    <pred>tcp-server-p</pred>

    <!-- inheritance -->
    <inherit>
      <name>TcpSocket</name>
    </inherit>

    <!-- constructors -->
    <ctor>
      <name>TcpServer</name>
      <args>none</args>
      <p>
      The <code>TcpServer</code> constructor creates a default tcp
      server.
      </p>
    </ctor>

    <ctor>
      <name>TcpServer</name>
      <args>Integer</args>
      <p>
      The <code>TcpServer</code> constructor creates a default tcp
      server which is bound on the specified port argument.
      </p>
    </ctor>

    <ctor>
      <name>TcpServer</name>
      <args>Integer Integer</args>
      <p>
      The <code>TcpServer</code> constructor creates a default tcp
      server which is bound on the specified port argument. The second
      argument is the backlog value.
      </p>
    </ctor>

    <ctor>
      <name>TcpServer</name>
      <args>String Integer</args>
      <p>
      The <code>TcpServer</code> constructor creates a tcp server by
      host name and port number. The first argument is the host
      name. The second argument is the port number.
      </p>
    </ctor>

    <ctor>
      <name>TcpServer</name>
      <args>String Integer Integer</args>
      <p>
      The <code>TcpServer</code> constructor creates a tcp server by
      host name and port number. The first argument is the host
      name. The second argument is the port number. The third argument
      is the backlog.
      </p>
    </ctor>
  </object>

  <!-- =================================================================== -->
  <!-- = datagram object                                                 = -->
  <!-- =================================================================== -->
  
  <object nameset="afnix:net">
    <name>Datagram</name>

    <!-- synopsis -->
    <p>
    The <code>Datagram</code> class is a socket class used by udp
    socket. A datagram is constructed by the <code>UdpSocket</code>
    <code>accept</code> method. The purpose of a datagram is to store
    the peer information so one can reply to the sender. The datagram
    also stores in a buffer the data sent by the peer. This class does
    not have any constructor nor any specific method.
    </p>

    <!-- predicate -->
    <pred>datagram-p</pred>

    <!-- inheritance -->
    <inherit>
      <name>Socket</name>
    </inherit>
  </object>

  <!-- =================================================================== -->
  <!-- = udp socket object                                               = -->
  <!-- =================================================================== -->
  
  <object nameset="afnix:net">
    <name>UdpSocket</name>

    <!-- synopsis -->
    <p>
    The <code>UdpSocket</code> class is a base class for all udp
    socket objects. The class is derived from the <code>Socket</code>
    class and provides some specific udp methods.
    </p>

    <!-- predicate -->
    <pred>udp-socket-p</pred>

    <!-- inheritance -->
    <inherit>
      <name>Socket</name>
    </inherit>

    <!-- constructors -->
    <ctor>
      <name>UdpSocket</name>
      <args>none</args>
      <p>
      The <code>UdpSocket</code> constructor creates a new udp socket.
      </p>
    </ctor>

    <!-- methods -->
    <method>
      <name>accept</name>
      <retn>Datagram</retn>
      <args>none</args>
      <p>
      The <code>accept</code> method waits for an incoming datagram
      and returns a <code>Datagram</code> object. The datagram is
      initialized with the peer address and port as well as the
      incoming data.
      </p>
    </method>
  </object>

  <!-- =================================================================== -->
  <!-- = udp client object                                               = -->
  <!-- =================================================================== -->
  
  <object nameset="afnix:net">
    <name>UdpClient</name>

    <!-- synopsis -->
    <p>
     The <code>UdpClient</code> class creates a udp client by host and
     port. The host argument can be either a name or an address
     object. The port argument is the server port to contact. The
     <code>UdpClient</code> class is derived from the
     <code>UdpSocket</code> class. This class has no specific methods.
    </p>

    <!-- predicate -->
    <pred>udp-client-p</pred>

    <!-- inheritance -->
    <inherit>
      <name>UdpSocket</name>
    </inherit>

    <!-- constructors -->
    <ctor>
      <name>UdpClient</name>
      <args>String Integer</args>
      <p>
      The <code>UdpClient</code> constructor creates a new udp client
      by host and port. The first argument is the host name. The
      second argument is the port number.
      </p>
    </ctor>
  </object>

  <!-- =================================================================== -->
  <!-- = udp server object                                               = -->
  <!-- =================================================================== -->
  
  <object nameset="afnix:net">
    <name>UdpServer</name>

    <!-- synopsis -->
    <p>
    The <code>UdpServer</code> class creates a udp server by port. An
    optional host argument can be either a name or an address
    object. The port argument is the server port to bind. The
    <code>UdpServer</code> class is derived from the
    <code>UdpSocket</code> class. This class has no specific
    methods. With one argument, the server bind the port argument on
    the local host. The host name can also be specified as the first
    argument, the port as second argument. Note that the host can be
    either a string or an address object.
    </p>

    <!-- predicate -->
    <pred>udp-server-p</pred>

    <!-- inheritance -->
    <inherit>
      <name>UdpSocket</name>
    </inherit>

    <!-- constructors -->
    <ctor>
      <name>UdpServer</name>
      <args>none</args>
      <p>
      The <code>UdpServer</code> constructor creates a default udp
      server object.
      </p>
    </ctor>

    <ctor>
      <name>UdpServer</name>
      <args>String|Address</args>
      <p>
      The <code>UdpServer</code> constructor creates a udp server
      object by host. The first argument is the host name or host address.
      </p>
    </ctor>

    <ctor>
      <name>UdpServer</name>
      <args>String|Address Integer</args>
      <p>
      The <code>UdpServer</code> constructor creates a udp server
      object by host and port. The first argument is the host name or
      host address. The second argument is the port number.
      </p>
    </ctor>
  </object>

  <!-- =================================================================== -->
  <!-- = multicast object                                                = -->
  <!-- =================================================================== -->
  
  <object nameset="afnix:net">
    <name>Multicast</name>

    <!-- synopsis -->
    <p>
    The <code>Multicast</code> class creates a udp multicast socket by
    port. An optional host argument can be either a name or an address
    object. The port argument is the server port to bind. The
    <code>Multicast</code> class is derived from the
    <code>UdpSocket</code> class. This class has no specific
    methods. With one argument, the server bind the port argument on
    the local host. The host name can also be specified as the first
    argument, the port as second argument. Note that the host can be
    either a string or an address object. This class is similar to the
    <code>UdpServer</code> class, except that the socket join the
    multicast group at construction and leave it at destruction.
    </p>

    <!-- predicate -->
    <pred>multicast-p</pred>

    <!-- inheritance -->
    <inherit>
      <name>UdpSocket</name>
    </inherit>

    <ctor>
      <name>Multicast</name>
      <args>String|Address</args>
      <p>
      The <code>Multicast</code> constructor creates a multicast socket
      object by host. The first argument is the host name or host address.
      </p>
    </ctor>

    <ctor>
      <name>Multicast</name>
      <args>String|Address Integer</args>
      <p>
      The <code>Multicast</code> constructor creates a multicast socket
      object by host and port. The first argument is the host name or
      host address. The second argument is the port number.
      </p>
    </ctor>
  </object>

  <!-- =================================================================== -->
  <!-- = global functions                                                = -->
  <!-- =================================================================== -->
  
  <function nameset="afnix:net">
    <name>get-loopback</name>
    <retn>String</retn>
    <args>none</args>
    <p>
    The <code>get-loopback</code> function returns the name of the
    machine loopback. On a UNIX system, that name is <tt>localhost</tt>. 
    </p>
  </function>

  <function nameset="afnix:net">
    <name>get-tcp-service</name>
    <retn>String</retn>
    <args>Integer</args>
    <p>
    The <code>get-tcp-service</code> function returns the name of the
    tcp service given its port number. For example, the tcp service at
    port 13 is the <tt>daytime</tt> server.
    </p>
  </function>

  <function nameset="afnix:net">
    <name>get-udp-service</name>
    <retn>String</retn>
    <args>Integer</args>
    <p>
    The <code>get-udp-service</code> function returns the name of the
    udp service given its port number. For example, the udp service at
    port 19 is the <tt>chargen</tt> server.
    </p>
  </function>
</appendix>
