diff options
Diffstat (limited to 'project2/proj2_s4498062/dns/server.py')
-rw-r--r-- | project2/proj2_s4498062/dns/server.py | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/project2/proj2_s4498062/dns/server.py b/project2/proj2_s4498062/dns/server.py index 7234e36..f412311 100644 --- a/project2/proj2_s4498062/dns/server.py +++ b/project2/proj2_s4498062/dns/server.py @@ -1,12 +1,9 @@ -#!/usr/bin/env python2 - """ A recursive DNS server This module provides a recursive DNS server. You will have to implement this server using the algorithm described in section 4.3.2 of RFC 1034. """ -import socket from threading import Thread @@ -15,9 +12,9 @@ class RequestHandler(Thread): def __init__(self): """ Initialize the handler thread """ - super().__init__() + super(RequestHandler).__init__() self.daemon = True - + def run(self): """ Run the handler thread """ # TODO: Handle DNS request @@ -29,7 +26,7 @@ class Server(object): def __init__(self, port, caching, ttl): """ Initialize the server - + Args: port (int): port that server is listening on caching (bool): server uses resolver with caching if true @@ -38,6 +35,7 @@ class Server(object): self.caching = caching self.ttl = ttl self.port = port + self.done = False # TODO: create socket def serve(self): |