Пример #1
0
 def connect(self, service=VoidService, config={}):
     """Same as :func:`~rpyc.utils.factory.connect`, but with the ``host`` and ``port``
     parameters fixed"""
     return rpyc.utils.factory.connect_stream(SocketStream(
         self._connect_sock()),
                                              service=service,
                                              config=config)
Пример #2
0
 def server(listener=listener):
     with closing(listener):
         client = listener.accept()[0]
     conn = connect_stream(SocketStream(client), service=remote_service,
                           config=remote_config)
     try:
         conn.serve_all()
     except KeyboardInterrupt:
         interrupt_main()
Пример #3
0
 def classic_connect(self):
     """Same as :func:`classic.connect <rpyc.utils.classic.connect>`, but with the ``host`` and
     ``port`` parameters fixed"""
     if self.local_port is None:
         # ParamikoMachine
         stream = SocketStream(
             self.remote_machine.connect_sock(self.remote_port))
         return rpyc.classic.connect_stream(stream)
     else:
         return rpyc.classic.connect("localhost", self.local_port)
Пример #4
0
 def server(listener=listener, args=args):
     with closing(listener):
         client = listener.accept()[0]
     conn = connect_stream(SocketStream(client), service=remote_service, config=remote_config)
     try:
         for k in args:
             conn._local_root.exposed_namespace[k] = args[k]
         conn.serve_all()
     except KeyboardInterrupt:
         interrupt_main()
Пример #5
0
 def connect(self, service=VoidService, config={}):
     """Same as :func:`connect <rpyc.utils.factory.connect>`, but with the ``host`` and ``port``
     parameters fixed"""
     if self.local_port is None:
         # ParamikoMachine
         stream = SocketStream(
             self.remote_machine.connect_sock(self.remote_port))
         return rpyc.connect_stream(stream, service=service, config=config)
     else:
         return rpyc.connect("localhost",
                             self.local_port,
                             service=service,
                             config=config)
Пример #6
0
 def classic_connect(self):
     """Same as :func:`classic.connect <rpyc.utils.classic.connect>`, but with the ``host`` and
     ``port`` parameters fixed"""
     return rpyc.utils.classic.connect_stream(
         SocketStream(self._connect_sock()))