[cse491] few questions

C. Titus Brown ctb at msu.edu
Wed Oct 28 18:55:58 PDT 2009


On Wed, Oct 28, 2009 at 09:07:41PM -0400, Steve Wakeford wrote:
> I am a little stumped as to why the Blocking server is instantiated in  
> the hw7 tests with
>
> server = webserve.Server(8000, app)
>
> but the Non-blocking server is instantiated with
>
> server = webserve_nb.NonblockingServer('', hello_app)
>
> Notice the first argument is an integer in the former and a string in  
> the latter. Is it just me or am I missing something? How do we deal with  
> this (for non-blocking) since the port should be dynamically passed in  
> upon instantiation from a command line argument?
>
> My goal is to subclass the Blocking server and only to override its  
> __init__() and serve_forever() methods. Any ideas?

Yes, I am an idjit and you are correct: the test is wrong.

I've fixed the code in svn.  You're welcome to pass either set of tests ;).

Note that I *do* still want your non-blocking web server to actually work when
called from the command line, too, so you should test that manually: i.e.

   python webserve_nb.py 5000

should work.

cheers,
--titus
-- 
C. Titus Brown, ctb at msu.edu



More information about the cse491-fall-2009 mailing list