私はRPCとPyroに全く慣れていないので、その概念を理解しようとしています.私はそれのウェブサイトの例をやっています.ns=False.Iのときに動作しているにもかかわらず、ns=Trueを実行するとコードが動作しません.このエラーが発生しています:
Pyro4.errors.NamingError: ネームサーバーを見つけられませんでした
ipdb でデバッグすると、次のように表示されます。
CommunicationError: 接続できません: [Errno 111] 接続が拒否されました
from __future__ import print_function
import Pyro4
import person
class Warehouse(object):
def __init__(self):
self.contents = ["chair", "bike", "flashlight", "laptop", "couch"]
def list_contents(self):
return self.contents
def take(self, name, item):
self.contents.remove(item)
print("{0} took the {1}.".format(name, item))
def store(self, name, item):
self.contents.append(item)
print("{0} stored the {1}.".format(name, item))
def main():
warehouse = Warehouse()
Pyro4.Daemon.serveSimple(
{
warehouse: "example.warehouse"
},
ns = True)
if __name__=="__main__":
main()
デーモンを起動しない解決策は何ですか?