def main():
    args = get_args()
    if args.version:
        print 'Poet version {}'.format(__version__)
        sys.exit(0)
    print_header()
    PORT = int(args.port) if args.port else 443
    try:
        s = PoetSocketServer(PORT)
    except socket.error as e:
        if e.errno == 13:
            die('You need to be root!')
    if os.geteuid() == 0:
        drop_privs()
    debug.info('Poet server started on port: {}'.format(PORT))
    module.load_modules()
    while True:
        try:
            conn, addr = s.accept()
        except __HOLE__:
            die()
        conntime = datetime.now().strftime(debug.DATE_FMT)
        ping = conn.recv(SIZE)
        if not ping:
            die('Socket error: {}'.format(e.message))
        auth_err = authenticate(ping)
        if auth_err:
            print '[!] ({}) Connected By: {} -> INVALID! ({})'.format(conntime, addr, auth_err)
            conn.close()
        else:
            print '[+] ({}) Connected By: {} -> VALID'.format(conntime, addr)
            conn.send(FAKEOK)
            conn.close()
            try:
                PoetServer(s).start()
                break
            except Exception as e:
                print e
                die('Fatal error: {}'.format(e.message))
    die()
dataset/ETHPy150Open mossberg/poet/server.py/main