Ejemplo n.º 1
0
def main():
    init_main("Network Protocol Test Tool")
    mainloop = gobject.MainLoop()
    ss = SimpleServer()
    ss.init(mainloop.quit)
    def start_client(*args):
        sc = SimpleClient()
        sc.init(mainloop.quit, [("hello", ()), ("disconnect", "because we want to")])
        return False
    gobject.timeout_add(1000*1, start_client)
    mainloop.run()
Ejemplo n.º 2
0
def main():
    init_main("Network Protocol Test Tool")
    mainloop = gobject.MainLoop()
    ss = SimpleServer()
    ss.init(mainloop.quit)

    def start_client(*args):
        sc = SimpleClient()
        sc.init(mainloop.quit, [("hello", ()),
                                ("disconnect", "because we want to")])
        return False

    gobject.timeout_add(1000 * 1, start_client)
    mainloop.run()
Ejemplo n.º 3
0
def main():
    init_main("Shadow Protocol Test Tool")
    if GTK:
        import gtk
        loop_exit = gtk.main_quit
        loop_run = gtk.main
    else:
        mainloop = gobject.MainLoop()
        loop_run = mainloop.run
        loop_exit = mainloop.quit
    XPRA_DISPLAY = ":10"
    sockfile = "~/.xpra/%s-%s" % (socket.gethostname(), XPRA_DISPLAY[1:])
    def server_timeout(*args):
        loop_exit()
        return False
    def server_start(*args):
        ss = SimpleServer()
        ss.init(loop_exit, os.path.expanduser(sockfile))
    gobject.timeout_add(1000, server_start)
    gobject.timeout_add(1000*120, server_timeout)
    loop_run()
Ejemplo n.º 4
0
def main():
    init_main("Shadow Protocol Test Tool")
    if GTK:
        import gtk
        loop_exit = gtk.main_quit
        loop_run = gtk.main
    else:
        mainloop = gobject.MainLoop()
        loop_run = mainloop.run
        loop_exit = mainloop.quit
    XPRA_DISPLAY = ":10"
    sockfile = "~/.xpra/%s-%s" % (socket.gethostname(), XPRA_DISPLAY[1:])

    def server_timeout(*args):
        loop_exit()
        return False

    def server_start(*args):
        ss = SimpleServer()
        ss.init(loop_exit, os.path.expanduser(sockfile))

    gobject.timeout_add(1000, server_start)
    gobject.timeout_add(1000 * 120, server_timeout)
    loop_run()