MCPcopy Create free account
hub / github.com/dabeaz/python-cookbook / rpc_server

Function rpc_server

src/11/implementing_remote_procedure_call/rpcserver.py:29–35  ·  view source on GitHub ↗
(handler, address, authkey)

Source from the content-addressed store, hash-verified

27from threading import Thread
28
29def rpc_server(handler, address, authkey):
30 sock = Listener(address, authkey=authkey)
31 while True:
32 client = sock.accept()
33 t = Thread(target=handler.handle_connection, args=(client,))
34 t.daemon = True
35 t.start()
36
37# Some remote functions
38def add(x, y):

Callers 1

rpcserver.pyFile · 0.70

Calls 2

acceptMethod · 0.80
startMethod · 0.45

Tested by

no test coverage detected