# [ee122] Assignment writeup for first phase of Project 1 updated

Vern Paxson vern at icir.org
Fri Sep 21 01:00:36 PDT 2007

We have updated the writeup in an attempt to clarify a few things:

- The server closes the connection.
- The server must handle multiple clients and partial request
lines from clients.
- What the server echoes to the client, and what it prints
to standard output.

Appended are "diffs" showing exactly what was changed.

Vern

Index: Project1A.tex
===================================================================
--- Project1A.tex	(revision 30)
+++ Project1A.tex	(revision 42)
@@ -136,11 +136,16 @@
\item The server listens for TCP connections on a port, specified as a
command line argument on startup.

-\item The server echoes back whatever data it receives on a TCP connection.
+\item The server echoes back the first line it receives on the TCP connection, prints
+  the line to standard output, and prints the components of the request or prints an
+  appropriate error for invalid requests.

+\item The server closes the connection with the client.
+
\item The server must be able to handle concurrent connections from multiple
clients.  This will entail use of {\tt select()}, as will be
-       discussed in section.
+       discussed in section. The server cannot wait on a single client to finish
+       sending while ignoring the other clients.

\end{enumerate}

@@ -182,11 +187,13 @@
\tt
\begin{tabular}{rcl}
Request-Line & = & Method +Space Request-URI +Space HTTP-Version *Space CRLF \\
-Method & = & "GET" \\
+Method & = & "GET" \\ \\
+
Request-URI & = & Absolute-Path \\
-HTTP-Version & = & "HTTP" "/" +DIGIT "." +DIGIT \\ \\
Absolute-Path & = & "/" *FileNameChar \\
FileNameChar & = & ALPHA | DIGIT | "." | "-" | "\_" | "/" \\ \\
+
+HTTP-Version & = & "HTTP" "/" +DIGIT "." +DIGIT \\ \\
Space & = & SP | TAB
\end{tabular}
}
@@ -222,15 +229,14 @@
the socket and determine which lines, if any, are legal HTTP GET requests.
For each line of input, your program should:
\begin{packed_list}
-\item Echo the line of input ({\it i.e.}, print the line of input to
-       the screen).
-\item For valid requests, list on subsequent lines the components of
-       the request.
-\item For invalid requests, print out an error message indicating
+\item Echo the line of input to both the client, and standard output.
+\item For valid requests, print to standard output the components of the request (these
+  should appear after the line of input).
+\item For invalid requests, print an error message on standard output indicating
which token is missing or illformed.
\end{packed_list}

-For a valid request, the output would be ({\it i.e.,} the server should return):
+For a valid request, the output to standard output would be ({\it i.e.,} the server should return):

{\tt
GET /Research/Areas/OSNT/index.html HTTP/1.0 \\
@@ -251,6 +257,12 @@
\end{tabular}

+\vspace{2mm}
+The server needs to be able to handle multiple clients connected simultaneously. This means
+that if you only receive part of a message, you must store it and handle other clients. You can't
+receive a partial message and keep attempting to receive from that client, while ignoring
+the other clients.
+
\subsubsection*{Client Behavior}
The client program at this stage will be a
program that requests an object from a web server and echoes the
@@ -304,8 +316,7 @@
server. The client need not do any other processing of the message other
than echo them to standard output.

-After processing the response received from the server, the client should
-close the socket to the server and read the next full URL from standard
+After the server closes the connection, read the next full URL from standard
input. When end-of-file is reached on standard input, the client program
should terminate.

@@ -378,7 +389,7 @@

\item Copy all the files that you wish to submit to this directory.

-       \item Change to the parent directory: {\tt \% cd ..}
+%       \item Change to the parent directory: {\tt \% cd ..}

\item Run the submit program: {\tt \% submit proj1a}