[ee122] [P1a] Client, server differing behaviour in parts A & B

Simon Tan simtan at berkeley.edu
Sat Sep 22 18:17:25 PDT 2007


1) In part A, the client is executed with the command http_client <server>  
<port> because, presumably, it will need to know where to connect to send  
its requests. (And, for that matter, where to reconnect each time because  
the server will close the connection repeatedly as requests are  
processed.) However, in part B, the client decides where to connect based  
on the URL it is given on STDIN. In an earlier thread, it was suggested  
that we only submit code that satisfies part B, but there is nothing in  
the spec that details how the client will be executed in part B. For  
submission, do we need to still support the execution command with the two  
arguments, even though there's really no reason for them to be used?  
(Right now, I'm just making the connection to the server and port given  
and then closing it.)

2) jaguar is a pure echo server that does not close the connection after  
responding, right? It was mentioned that it should only be used for  
testing with Part A, but even part A now says that the server should close  
the connection with the client. Since both part A and B suggest the server  
always closes the connection with the client, I am under the impression  
that a client will always RECV repeatedly until the connection is closed  
by the other side. Otherwise, how would the client know when the server is  
done responding? Checking for the "\r\n" is only a partial solution - in  
reality, a ton of data follows the "\r\n" (i.e. try using your client to  
make a GET request from http://www.google.com/). So I have my client  
RECVing until the server's done. However, if the server doesn't ever close  
the connection, my client will never be open to more input from STDIN. Is  
this the correct behaviour?

Thanks.

-- 
~Simon Tan >> undergraduate at UC Berkeley
Source: simtan at berkeley.edu


More information about the ee122 mailing list