Homework 8, due Mar 20th, 2012ΒΆ

  1. Modify your code from HW #7 (serve2.py) so that it is robust to GET requests being received in incomplete chunks. (Think: what if your ‘recv’ call doesn’t return the entire request?)

  2. Test your code at the socket API level with a dependency injection approach. (You shouldn’t need to change your code-under-test at all to pass these tests.)

  3. Implement either a threaded or a non-blocking approach (please flip a coin!) to multiprocessing – handling multiple connections at the same time. You can use code as in the echo-server stuff, OR (for threading) look at the ‘multiprocessing’ library. Up to you.

    Put this implementation in ‘serve3.py’.

    (How would you test this by hand? Hint: put ‘time.sleep(10)’ in various meep Web functions and see if other requests are processed concurrently.)

Previous topic

In-class Links - Mar 1st, 2012

Next topic

In-class Links - Feb 28th, 2012

This Page