| Tomer Filiba tomerfiliba.com |
Hello,
I would like to get an IP addresses of the client (and preferably the server) from within the method. Is it possible? Ultimately I would like the following piece of code to work:#!/usr/bin/python
import rpyc
import config
class Server(rpyc.Service):
def exposed_get_addrs(self):
""" Return a tuple of client and server addresses """
client_addr = ...
server_addr = ...
return (client_addr, server_addr)
if __name__ == "__main__":
from rpyc.utils.server import ThreadedServer
t = ThreadedServer(Server, port = config.PORT)
t.start()
If I could get hold of the socket handle, I could use getsockname/addr methods, but how to get the socket? I browsed through the sources, and found that the socket seems to sit in Stream, Stream is in Channel, but it is not obvious for me how to get channel from inside of the method.
Best regards,
Alex
--
---
You received this message because you are subscribed to the Google Groups "rpyc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rpyc+uns...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.