Esempio n. 1
0
def run_client(host=DEFAULT_HOST, port=DEFAULT_PORT, unix_socket=None, stacks=True, ipython=True, greenlets=True):
    conn = connect(host=host, port=port) if unix_socket is None else unix_connect(unix_socket)
    if stacks:
        print conn.modules['pystuck.thread_probe'].stacks_repr(greenlets=greenlets)
    if ipython:
        from pystuck.ipython import ishell
        modules = conn.modules
        print "use the 'modules' dictionary to access remote modules (like 'os', or '__main__')"
        ishell()
Esempio n. 2
0
def run_client(host=DEFAULT_HOST, port=DEFAULT_PORT, stacks=False, ipython=True,
               greenlets=True):
    from rpyc.utils.classic import connect
    conn = connect(host=host, port=port)
    if stacks:
        print(conn.modules['pystuck.thread_probe'].stacks_repr(
            greenlets=greenlets))
    if ipython:
        from pystuck.ipython import ishell
        modules = conn.modules
        ishell(local_ns=locals())
Esempio n. 3
0
def run_client(host=DEFAULT_HOST,
               port=DEFAULT_PORT,
               stacks=False,
               ipython=True,
               greenlets=True):
    from rpyc.utils.classic import connect
    conn = connect(host=host, port=port)
    if stacks:
        print(conn.modules['pystuck.thread_probe'].stacks_repr(
            greenlets=greenlets))
    if ipython:
        from pystuck.ipython import ishell
        modules = conn.modules
        ishell(local_ns=locals())
Esempio n. 4
0
def run_client(host=DEFAULT_HOST,
               port=DEFAULT_PORT,
               unix_socket=None,
               stacks=True,
               ipython=True,
               greenlets=True):
    from rpyc.utils.classic import connect, unix_connect
    conn = connect(
        host=host,
        port=port) if unix_socket is None else unix_connect(unix_socket)
    if stacks:
        print(conn.modules['pystuck.thread_probe'].stacks_repr(
            greenlets=greenlets))
    if ipython:
        from pystuck.ipython import ishell
        modules = conn.modules
        print(
            "use the 'modules' dictionary to access remote modules (like 'os', or '__main__')"
        )
        ishell()
Esempio n. 5
0
File: rpc.py Progetto: ya-mouse/qbee
    def __init__(self, host, port=None, ipv6=True,
                 ssl_keyfile=None, ssl_certfile=None, ssl_cafile=None):
        self._host = host
        self._port = port
        self._ipv6 = ipv6
        self._ssl_keyfile = ssl_keyfile
        self._ssl_certfile = ssl_certfile
        self._ssl_cafile = ssl_cafile

        if self._ssl_keyfile:
            self._authenticator = SSLAuthenticator(self._ssl_keyfile, self._ssl_certfile,
                self._ssl_cafile)
            default_port = DEFAULT_SERVER_SSL_PORT
        else:
            self._authenticator = None
            default_port = DEFAULT_SERVER_PORT
        if self._port is None:
            self._port = default_port

        if self._ssl_keyfile:
            self._conn = ssl_connect(self._host, port = self._port, keyfile = self._ssl_keyfile,
                                    certfile = self._ssl_certfile, ca_certs = self._ssl_ca_certs, ipv6 = self._ipv6)
        else:
            self._conn = connect(self._host, port = self._port, ipv6 = self._ipv6, keepalive = True)