Computer Networks

Practical exercises #7

  1. The example code in the lecture uses getservbyname() to map well-known services to port numbers. How is this performed on your generic Unix box? What about on other systems?

  2. The example client code given in the lecture is a cut-down version of this program. Save the program source code from your browser and try compiling and executing it. Change the port number to 80, for HTTP, and modify the string sent to the server so this program can be used for "Web page fetching".

  3. On ironbark, look at /usr/local/pub/BITCNE for some more sample code for manipulating sockets. Copy the example there to your directory and try it out.

  4. To come: lots of sample Java code for socket manipulations...

  5. For the experienced C++ programmers in the class: investigate the socket++ libraries on ironbark.

This set of practical exercises accompanies Tutorial #7.
La Trobe Uni Logo [Previous Practical] [Tutorial Index] [Next Practical]
Copyright © 2000 by Phil Scott, La Trobe University.
Valid HTML 3.2!