jefrailey/network_tools — pull request #4 by sazlin (2014-06-13 22:29:18+00:00)
Title: Added http_server_my.py and the HttpServerMT class, which extends HttpSe...

...rver and adds support for processing multiple simultaneous client connections using threading.Thread. Also changed test_http.py to import HttpServerMT instead of HttpServer, and added a new multi-threaded test that spins up a HttpServerMT server in its own thread, and then 10 simple clients each in their own thread to bombard the Http server simultaneously-ish. Py.test's UI thread then waits for all the client threads to finish then validates the response of each client. Asserts true when all responses come back ok. Note that only partial validation is done at this point. Note that HttpServerMT's start_listening() method isn't shutting down gracefully when the server is started via py.test. The server will likely run until the py.test process finishes, which is really gross. We are half-way to fixing this by extending Thread with StoppableThread, but we haven't plumbed that in to HttpServerMT yet so StoppableThread isn't really yielding us anything useful yet.