In this section you are going to write a new socket library libcachedsocket.so that will cache TCP/IP connections. You are going to use the same technique used in the previous part. You will write your own socket functions to cache TCP/IP connections that then may/may not call the real socket calls.
Your library does not need to run for all the programs. You are going to concentrate on running your library with the non-fork version of the web server httpd and the web client mosaic. The sources of these programs are provided in /u/u3/603/96spring/project1/part2. The sources are only for reference. They should not be modified.
You will have to install and configure your own copy of httpd. To help you in this task follow these steps:
chs> cd csh> cp -r /u/u3/603/96spring/project1/part2/httpd-1.4.2 . csh> cd httpd-1.4.2
old-> Port 8080 new-> Port <DAY-OF-BIRTH(YYMMDD)> old-> ServerRoot /u/u3/603/96spring/project1/part2/httpd-1.4.2 new-> ServerRoot <ABSOLUTE-PATH-HOME-DIR>/httpd-1.4.2
old-> DocumentRoot .../project1/part2/httpd-1.4.2/what-i-want-to-export new-> DocumentRoot <ABSOLUTE-PATH-HOME-DIR>/httpd-1.4.2/what-i-want-to-export
csh> ./httpd -d .
csh> kill -9 `cat logs/httpd.pid`
You can start by tracing which socket calls Mosaic and httpd make to establish connections and exchange information. These calls are the calls you have to reimplement to cache connections. You can measure the efficiency of your implementation by the number of real connections that are opened compared to the connections that the program thinks is opening. The html file what-i-want-to-export/index.html includes several graphics so you can use it as a test file.
Good Luck.