How to use the rpyc.connect function in rpyc

To help you get started, we’ve selected a few rpyc examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github tomerfiliba / rpyc / tests / test_attr_access.py View on Github external
def _get_myclass(self, proto_config):
        self.conn.close()
        self.server.protocol_config.update(proto_config)
        self.conn = rpyc.connect("localhost", self.server.port)
        return self.conn.root.MyClass()
github fake-name / IntraArchiveDeduplicator / interactive_tests / test_interface.py View on Github external
def doListDupes(on_file):
	print("Finding files similar to: '{}'".format(on_file))
	remote = rpyc.connect("localhost", 12345)
	commons = remote.root.listDupes(filePath=on_file)
	print("result:")
	print(commons)
	print("Wut?")
github tomerfiliba / rpyc / tests / test_service_pickle.py View on Github external
def setUp(self):
        self.cfg = {'allow_pickle': True}
        self.server = rpyc.utils.server.ThreadedServer(MyService, port=0, protocol_config=self.cfg.copy())
        self.server.logger.quiet = False
        self.thd = self.server._start_in_thread()
        self.conn = rpyc.connect("localhost", self.server.port, config=self.cfg)
        self.conn2 = rpyc.connect("localhost", self.server.port, config=self.cfg)
        # globals are made available to timeit, prepare them
        cfg_tests.timeit['conn'] = self.conn
        cfg_tests.timeit['conn2'] = self.conn2
        cfg_tests.timeit['df'] = pd.DataFrame(np.random.rand(DF_ROWS, DF_COLS))
github fake-name / IntraArchiveDeduplicator / deduplicator / ProcessArchive.py View on Github external
scanner.logSetup.initLogging()

	if not os.path.exists(scanConf.sourcePath):
		# print("ERROR: Source file does not exist!")
		return
	if not os.path.isfile(scanConf.sourcePath):
		# print("ERROR: Source is not a file!")
		return

	if scanConf.noContext:
		scanContext = None
	else:
		scanContext = [os.path.split(scanConf.sourcePath)]

	remote = rpyc.connect("localhost", 12345)

	status, bestMatch, intersections = remote.root.processDownload(
		scanConf.sourcePath,
		pathNegativeFilter=scanContext,
		distance=6,
		moveToPath=None,
		locked=True)
	# print("Processed archive. Return status '%s'", status)
	if bestMatch:
		print("Matching archive '%s'", bestMatch)
	return status, bestMatch, intersections
github stroucki / tashi / src / tashi / rpycservices / rpycservices.py View on Github external
def createConn(self):
		"""Creates a rpyc connection."""
		if self.username != None and self.password != None:
			return rpyc.tlslite_connect(host=self.host, port=self.port, username=self.username, password=self.password)
		else:
			return rpyc.connect(host=self.host, port=self.port)
github stroucki / tashi / src / zoni / services / rpycservices.py View on Github external
def createConn(self):
		"""Creates a rpyc connection."""
		if self.username != None and self.password != None:
			return rpyc.tlslite_connect(host=self.host, port=self.port, username=self.username, password=self.password)
		else:
			return rpyc.connect(host=self.host, port=self.port)
github sanketplus / PyDFS / pydfs / client.py View on Github external
def main(args):
  con=rpyc.connect("localhost",port=2131)
  master=con.root.Master()
  
  if args[0] == "get":
    get(master,args[1])
  elif args[0] == "put":
    put(master,args[1],args[2])
  else:
    LOG.error("try 'put srcFile destFile OR get file'")
github danfang / rmw / src / rmw_cli.py View on Github external
def clear(self, index = None):
        try:
            c = rpyc.connect("localhost", 18861)
            return c.root.clear(index)
        except:
            return 'Unable to connect'
github sanketplus / PyDFS / pydfs / client.py View on Github external
def send_to_minion(block_uuid,data,minions):
  LOG.info("sending: " + str(block_uuid) + str(minions))
  minion=minions[0]
  minions=minions[1:]
  host,port=minion

  con=rpyc.connect(host,port=port)
  minion = con.root.Minion()
  minion.put(block_uuid,data,minions)