gawkinet: Troubleshooting

1 
1 2.3 Troubleshooting Connection Problems
1 =======================================
1 
1 It may well be that for some reason the program shown in the previous
1 example does not run on your machine.  When looking at possible reasons
1 for this, you will learn much about typical problems that arise in
1 network programming.  First of all, your implementation of 'gawk' may
1 not support network access because it is a pre-3.1 version or you do not
1 have a network interface in your machine.  Perhaps your machine uses
1 some other protocol, such as DECnet or Novell's IPX. For the rest of
1 this major node, we will assume you work on a Unix machine that supports
1 TCP/IP. If the previous example program does not run on your machine, it
1 may help to replace the name 'localhost' with the name of your machine
1 or its IP address.  If it does, you could replace 'localhost' with the
1 name of another machine in your vicinity--this way, the program connects
1 to another machine.  Now you should see the date and time being printed
1 by the program, otherwise your machine may not support the 'daytime'
1 service.  Try changing the service to 'chargen' or 'ftp'.  This way, the
1 program connects to other services that should give you some response.
1 If you are curious, you should have a look at your '/etc/services' file.
1 It could look like this:
1 
1      # /etc/services:
1      #
1      # Network services, Internet style
1      #
1      # Name     Number/Protocol  Alternate name # Comments
1 
1      echo        7/tcp
1      echo        7/udp
1      discard     9/tcp         sink null
1      discard     9/udp         sink null
1      daytime     13/tcp
1      daytime     13/udp
1      chargen     19/tcp        ttytst source
1      chargen     19/udp        ttytst source
1      ftp         21/tcp
1      telnet      23/tcp
1      smtp        25/tcp        mail
1      finger      79/tcp
1      www         80/tcp        http      # WorldWideWeb HTTP
1      www         80/udp        # HyperText Transfer Protocol
1      pop-2       109/tcp       postoffice    # POP version 2
1      pop-2       109/udp
1      pop-3       110/tcp       # POP version 3
1      pop-3       110/udp
1      nntp        119/tcp       readnews untp  # USENET News
1      irc         194/tcp       # Internet Relay Chat
1      irc         194/udp
1      ...
1 
1    Here, you find a list of services that traditional Unix machines
1 usually support.  If your GNU/Linux machine does not do so, it may be
1 that these services are switched off in some startup script.  Systems
1 running some flavor of Microsoft Windows usually do _not_ support these
1 services.  Nevertheless, it _is_ possible to do networking with 'gawk'
1 on Microsoft Windows.(1)  The first column of the file gives the name of
1 the service, and the second column gives a unique number and the
1 protocol that one can use to connect to this service.  The rest of the
1 line is treated as a comment.  You see that some services ('echo')
1 support TCP as well as UDP.
1 
1    ---------- Footnotes ----------
1 
1    (1) Microsoft preferred to ignore the TCP/IP family of protocols
1 until 1995.  Then came the rise of the Netscape browser as a landmark
1 "killer application."  Microsoft added TCP/IP support and their own
1 browser to Microsoft Windows 95 at the last minute.  They even
1 back-ported their TCP/IP implementation to Microsoft Windows for
1 Workgroups 3.11, but it was a rather rudimentary and half-hearted
1 implementation.  Nevertheless, the equivalent of '/etc/services' resides
1 under 'C:\WINNT\system32\drivers\etc\services' on Microsoft Windows 2000
1 and Microsoft Windows XP.
1