CIS 432/532 Introduction to Computer Networks
Winter 2001

Program #1 Addendum

Error Handling

For both Java and C, your client should prevent any incorrect command from being sent to the server. If the user enters an invalid command or is missing a colon, the client should print an error as follows:

%alternating:Please do alternating upper- and lowercase letters.
Invalid command: alternating
%text without a colon
Error: text missing a colon

Likewise, your server should check for these errors, in case a misbehaving client contacts it. If the server detects a bad command, it should return an error to the client, as shown below:

%junk:My client doesn't check for bad commands.
Invalid command: junk
%My client doesn't check for missing colons either!

Error: text missing a colon