Esempio n. 1
0
def dmproc_disconnect(opts, state):
    helpers.send_frame(state["dmproc"][0], "close;")
    state["dmproc"][1].join()
    for x in state["dmproc"][2]:
        dump(__stdout__, x)
    dump(__stdout__, "\n")
    del (state["dmproc"])
    return (0)
Esempio n. 2
0
def dmproc_disconnect(opts, state):
    helpers.send_frame(state["dmproc"][0], "close;")
    state["dmproc"][1].join()
    for x in state["dmproc"][2]:
        dump(__stdout__, x)
    dump(__stdout__, "\n")
    del(state["dmproc"])
    return(0)
Esempio n. 3
0
def dmproc_connect(opts, state, proc):
    s = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM, 0)
    s.connect(opts.config.get("xmpp", "dmproc"))
    helpers.send_frame(s, proc)
    status = helpers.recv_frame(s)
    if (status == "status 0;"):
        t = threading.Thread(target=dmproc_consume, args=(state, ))
        state["dmproc"] = (s, t, [])
        t.start()
        return (0)
    else:
        return (1)
Esempio n. 4
0
def dmproc_connect(opts, state, proc):
    s = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM, 0)
    s.connect(opts.config.get("xmpp", "dmproc"))
    helpers.send_frame(s, proc)
    status = helpers.recv_frame(s)
    if (status == "status 0;"):
        t = threading.Thread(target=dmproc_consume, args=(state,))
        state["dmproc"] = (s, t, [])
        t.start()
        return(0)
    else:
        return(1)