next up previous
Next: About this document Up: No Title Previous: What to turn

Part 2: Cached Socket Libray

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:

  1. Copy the directory /u/u3/603/96spring/project1/part2/httpd-1.4.2 to your home directory, and change to the new httpd-1.4.2/ directory.
       chs> cd
       csh> cp -r /u/u3/603/96spring/project1/part2/httpd-1.4.2 .
       csh> cd httpd-1.4.2
    

  2. Modify the following entries of the conf/httpd.conf file:
       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
    

  3. Modify the following entries of the conf/srm.conf file.
       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
    

  4. Now run the http deamon
       csh> ./httpd -d .
    

  5. To access your http server run Mosaic and open location: http://MACHINE-WHERE-YOUR-HTTPD-IS-RUNNING:PORT

  6. You can modify the file what-i-want-to-export/index.html to export other files you want.

  7. To kill the http program execute:
       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.


Gustavo Rodriguez-Rivera
Tue Feb 13 16:34:51 EST 1996