a Test the demonstration networking client.
Running the networking client should cause it to request a file from a well known web site, and print out the response, which should indicate that the requested file does not exist. You need to capture this test in your report.
b Add command line processing to the networking client.
The address, port number, and file requested have been hard coded into the demonstration client, and you need to change this so that they are specified on the command line.
c)Add error handling to the networking client.
The demonstration client has no error handling. If it fails, then it fails mysteriously. Error handling is required in order to turn this into professional code.
The error handling you are expected to implement in the client should display an error on "stderr" and then quit. There needs to be error handling for:-
•The command line processing. There could be the wrong number of arguments, or the arguments could be invalid.
•The opening of a "FILE*" stream, using "fdopen".
•Reading or writing to the TCP stream.
•Some of the netCli_???() calls return an error indicator.
You need to read the documentation and modify your code to check for an error return. When you detect an error return from a framework routine, you need to obtain the details of the error using an error message method, which in this case is netCli_getErrMsg().
CscLib has a few validation routines that may be helpful, and the documentation for them can be found in isvalid.h.
d) [3 marks] Test the demonstration networking server.
Running the networking server should cause it to listen for connections and read one line from each connection before closing the connection. You can test it from a second command line window using a telnet client. For example, if we do the following in our second window:-