Here is my code to run the server:
class MyRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler): #.... PORT = 8089 httpd = SocketServer.TCPServer(
It is because you have to set SO_REUSEADDRESS before you bind the socket. As you are creating and binding the socket all in one step and then setting it, it is already too late.