Discussion of Activity 9.7 - Testing the name server

  1. It is important to ensure that the server is running before you try to run the telnet client. The server should display a message to indicate that it is starting up.

  2. If you omit the port number from the telnet command, then telnet defaults to trying port 23, which in this case will not work. There is nothing special about port 3000 but the client and server must use the same port number.

    We have seen in a previous activity how to use a simple Java class as a client. Using telnet as the client shows that there is nothing special about the Java clients - they use the same TCP/IP protocols as telnet. In the next activity we will see how to use a Java client that has a graphical user interface. The server program does not know what sort of client we are using - it simply responds to messages sent across the socket connection, via the streams.

  3. This server can only deal with one client at a time. If the server is already connected to a client, any other clients which try to connect will be queued and will be serviced in order, one at a time. You can try this by running several telnet programs at the same time (you need a command prompt window for each telnet client). You enter the same telnet command as before in each window, in order to request a connection to the server. Only the first telnet client will get a response to any user names you enter. You can try entering user names into the other clients but you will get no response until you quit from the first client. Then the second client will get responses until you quit from this, and so on.

    This behaviour is useful but not ideal. We will see later how to make the server responsive to several clients at once.