it is set by the server here: https://github.com/tomerfiliba/rpyc/blob/master/rpyc/utils/server.py#L190
----------------------------------------------------------------- *Tomer Filiba* tomerfiliba.com <http://www.facebook.com/tomerfiliba> <http://il.linkedin.com/in/tomerfiliba> On Fri, Mar 8, 2013 at 6:42 PM, Tomer Filiba <[email protected]> wrote: > see the "endpoints" attribute of the connection dictionary: > > http://rpyc.readthedocs.org/en/latest/api/core_protocol.html#rpyc.core.protocol.DEFAULT_CONFIG > > > -tomer > > ----------------------------------------------------------------- > > *Tomer Filiba* > tomerfiliba.com <http://www.facebook.com/tomerfiliba> > <http://il.linkedin.com/in/tomerfiliba> > > > On Fri, Mar 8, 2013 at 5:48 PM, Alexandre Bezroutchko > <[email protected]>wrote: > >> 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 [email protected]. >> For more options, visit https://groups.google.com/groups/opt_out. >> >> >> > > -- --- 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 [email protected]. For more options, visit https://groups.google.com/groups/opt_out.
