Classic mode works as the tutorial describes where server and client are on 
the same machine.

If running the server on a remote machine and connecting a client over the 
Internet using SSH, it works differently.

On the remote I run:

rpyc_classic.py --host=localhost
INFO:SLAVE/18812:server started on [127.0.0.1]:18812

On my local machine I run:

sshctx = SshContext("remote_host", user = "username")
conn = rpyc.ssh_connect(sshctx, 18812)

On the remote:
INFO:SLAVE/18812:accepted 127.0.0.1:46452
INFO:SLAVE/18812:welcome [127.0.0.1]:46452

On the local machine:

>>> conn.modules.sys
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'Connection' object has no attribute 'modules'

Does anyone know how this works?

>>> pprint(dir(conn.root))
['ALIASES',
 '__class__',
 '__delattr__',
 '__doc__',
 '__format__',
 '__getattribute__',
 '__hash__',
 '__init__',
 '__module__',
 '__new__',
 '__reduce__',
 '__reduce_ex__',
 '__repr__',
 '__setattr__',
 '__sizeof__',
 '__slots__',
 '__str__',
 '__subclasshook__',
 '_conn',
 '_rpyc_delattr',
 '_rpyc_getattr',
 '_rpyc_setattr',
 'exposed_eval',
 'exposed_execute',
 'exposed_get_service_aliases',
 'exposed_get_service_name',
 'exposed_getconn',
 'exposed_getmodule',
 'exposed_namespace',
 'get_service_aliases',
 'get_service_name',
 'on_connect',
 'on_disconnect']

>>> pprint(dir(conn))
['_HANDLERS',
 '__class__',
 '__del__',
 '__delattr__',
 '__dict__',
 '__doc__',
 '__enter__',
 '__exit__',
 '__format__',
 '__getattribute__',
 '__hash__',
 '__init__',
 '__module__',
 '__new__',
 '__reduce__',
 '__reduce_ex__',
 '__repr__',
 '__setattr__',
 '__sizeof__',
 '__str__',
 '__subclasshook__',
 '__weakref__',
 '_access_attr',
 '_async_callbacks',
 '_async_request',
 '_box',
 '_channel',
 '_check_attr',
 '_cleanup',
 '_closed',
 '_config',
 '_dispatch',
 '_dispatch_exception',
 '_dispatch_reply',
 '_dispatch_request',
 '_handle_buffiter',
 '_handle_call',
 '_handle_callattr',
 '_handle_close',
 '_handle_cmp',
 '_handle_del',
 '_handle_delattr',
 '_handle_dir',
 '_handle_getattr',
 '_handle_getroot',
 '_handle_hash',
 '_handle_inspect',
 '_handle_oldslicing',
 '_handle_pickle',
 '_handle_ping',
 '_handle_repr',
 '_handle_setattr',
 '_handle_str',
 '_init_service',
 '_last_traceback',
 '_local_objects',
 '_local_root',
 '_netref_classes_cache',
 '_netref_factory',
 '_proxy_cache',
 '_recv',
 '_recvlock',
 '_remote_root',
 '_send',
 '_send_exception',
 '_send_reply',
 '_send_request',
 '_sendlock',
 '_seqcounter',
 '_sync_replies',
 '_unbox',
 'async_request',
 'close',
 'closed',
 'fileno',
 'ping',
 'poll',
 'poll_all',
 'root',
 'serve',
 'serve_all',
 'sync_request']


Reply via email to