I'm working on a program in python using rpyc. My goal is to create a simple server that accepts bytes of data (String) from a client. I'm new both to python and rpyc. Here is my server.py code:
from rpyc.utils.server import ThreadedServer # or ForkingServer
class MyService(rpyc.Service):
# My service
pass
if __name__ == "__main__":
server = ThreadedServer(MyService, port = 18812)
server.start()
Then there is my client.py code:
from rpyc.core.stream import SocketStream
from rpyc.core.channel import Channel
b = SocketStream.connect("localhost", 18812)
c = Channel(b, compress=True)
c.send("abc")
b.close()
c.close()
Yet when running my client.py there is an error in console. If I'm understanding it correctly, i must create a stream in server.py that is associated with the client. Is that the case? How can i achieve that?