def main(): # print command line arguments args = sys.argv if len(args) != 6: print 'Insufficient Arguments' global lsListenPort global ts1Hostname global ts1ListenPort global ts2Hostname global ts2ListenPort lsListenPort = int(args[1]) ts1Hostname = args[2] ts1ListenPort = int(args[3]) ts2Hostname = args[4] ts2ListenPort = int(args[5]) server = Server(lsListenPort) ts1client = Client() ts2client = Client() server.accept() contactTSservers(server, ts1client, ts2client) server.close()
def main(): args = sys.argv if len(args) != 2: print 'Insufficient Arguments' tsListenPort = int(args[1]) populateDNStable() server = Server(tsListenPort) server.accept() queryDNStable(server) server.close()