| ERODD HOME | Malone Home |
For this lab, you will modify the sample JAVA sockets client to add function. We are essentially programming the function we performed manually with telnet in the homework exercise. In particular, we want to:
Remember to compile and run JAVA (WINDOWS or LINUX):
sockiii.java (iii = your initials)using "vi" on LINUX or Notepad or other editor on Windows.
javac sockiii.java
java sockiii
WINDOWS: COPY sockiii.java T:\ERODD\STUDENTS LINUX in TS111: tot sockiii.java
The program sample to start with is in the file:
WINDOWS: T:\ERODD\TCPCLI.JAVA LINUX: /home/square/tdrive/erodd/tcpcli.java
for (int i=0; i<10; i++)
{
// read the socket
// display the results
}
Read enough lines (the above example would be 10) to read the HTTP header and some HTML. If you try to read too many lines, you will just get a lot of "null" results.
Copy your program to the instructor tdrive.
Printed copy of your program with a handwritten notation of
what host and URL you tested with.
Remember on LINUX print with:
a2ps sockiii.java
The maximum grade without this extra is 95%. The maximum grade with this extra challenge is 120.
The extra challenge is: Write logic to read exactly as much data as the server sends. Hint: There is information in the HTTP header you need. Look at an Ethereal trace to find it.