[cse491] Lab 7 changes

Tim Miller mille449 at gmail.com
Fri Oct 16 19:47:45 PDT 2009


---------- Forwarded message ----------
From: Tim Miller <mille449 at gmail.com>
Date: Fri, Oct 16, 2009 at 10:47 PM
Subject: Re: [cse491] Lab 7 changes
To: Joe Amenta <amentajo at msu.edu>


__main__ creates an instance of your webserve.Server class then calls
Server.serve_forever().  That is all.  The serve_forever() function will
bind the port then enter the 'main' while loop to accept connections and
pass them to handle_connection().

If you look in the new test_webserve.py you can see how it will be called.
Webserve_Test._run_fake_socket() is a replacement for our serve_forever()
function, so our serve_forever() function should do the same thing but with
a real socket.

Those are pretty much the same as before, most of the changes for the
project come in the splitting up the parse_request() function into a wsgi
app and the means to call it correctly.


--tim




On Fri, Oct 16, 2009 at 5:32 PM, Joe Amenta <amentajo at msu.edu> wrote:

> Also, there's this in the lab notes:
>
> Next, get your 'server_forever' and __main__ code working (it should
> all still work as in HW #5).
>
> --Joe
>
> On Fri, Oct 16, 2009 at 5:31 PM, Joe Amenta <amentajo at msu.edu> wrote:
> > A little bit of an ambiguity...  in the homework notes, you write:
> >     Server.handle_forever() must bind to the given port and serve HTTP
> > requests on it forever, calling the WSGI app object for each request.
> >
> > But in the lab notes, you write:
> >     write a method 'Server.serve_forever()' that does your main while
> loop.
> >     change your __main__ block to run Server.serve_forever() on the
> > appropriate port.
> >
> > Which is it?
> >
> > *ducks the shoe Titus is about to throw*
> >
> > --Joe
> >
> > On Fri, Oct 16, 2009 at 11:23 AM, C. Titus Brown <ctb at msu.edu> wrote:
> >>
> >> thanks again!
> >>
> >> On Thu, Oct 15, 2009 at 05:40:10PM -0400, Joe Amenta wrote:
> >> > Also, don't forget to change environ['wsgi_input'] to
> environ['wsgi.input'].
> >> >
> >> > --Joe
> >> >
> >> > On Thu, Oct 15, 2009 at 05:16:54PM -0400, Joe Amenta wrote:
> >> > > Don't forget to:
> >> > > --def WSGIApp(object) -> class WSGIApp(object)
> >> > > --return ['Hello, world'] -> return iter(['Hello, world'])
> >> > >
> >> > > --Joe
> >>
> >> --
> >> C. Titus Brown, ctb at msu.edu
> >
>
> _______________________________________________
> cse491-fall-2009 mailing list
> cse491-fall-2009 at lists.idyll.org
> http://lists.idyll.org/listinfo/cse491-fall-2009
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.idyll.org/pipermail/cse491-fall-2009/attachments/20091016/1780c9c2/attachment.htm>


More information about the cse491-fall-2009 mailing list