Connect to a clacks server from another interpreter with a clacks proxy
Sun Apr 02 2023 22:32:15 GMT+0000 (Coordinated Universal Time)
Saved by
@MaVCArt
#python
import clacks
# -- first we create a handler / marshaller pair.
# -- as we know the server used the "simple" handler / marshaller combination on this port, we recreate its exact
# -- copy here. Otherwise, the handler will not be able to talk to the server.
handler = clacks.SimpleRequestHandler(clacks.SimplePackageMarshaller())
# -- now we can create a proxy for the "simple" server port.
proxy = clacks.ClientProxyBase(('localhost', 9998), handler=handler, connect=True)
# -- and now we can run methods on this proxy just as if we were running them directly on the server.
print(proxy.list_commands())
content_copyCOPY
Comments