示例#1
0
文件: ls.py 项目: Lukeschroeder/net2
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()
示例#2
0
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()