对等方关闭的 rpyc 连接

Joh*_*Huo 5 python eoferror rpyc

我正在关注此页面上的 rpyc 教程,但在运行此代码时出现 EOFError

bgsrv = rpyc.BgServingThread(conn) #creates a bg thread to process incoming events
Run Code Online (Sandbox Code Playgroud)

我已经搜索了很多,但没有找到解决这个问题的方法。服务器和客户端运行在同一台机器上。我在 macbook pro 上运行脚本。需要帮助修复此错误。

您可以在此处找到 stream.py 的源代码。

这是回溯:

Exception in thread Thread-10:
Traceback (most recent call last):
  File"/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 810, in __bootstrap_inner
    self.run()
  File"/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 763, in run
    self.__target(*self.__args, **self.__kwargs)
File "/Library/Python/2.7/site-packages/rpyc-3.3.0-py2.7.egg/rpyc/utils/helpers.py", line 204, in _bg_server
    self._conn.serve(self.SERVE_INTERVAL)
File "/Library/Python/2.7/site-packages/rpyc-3.3.0-py2.7.egg/rpyc/core/protocol.py", line 387, in serve
    data = self._recv(timeout, wait_for_lock = True)
File "/Library/Python/2.7/site-packages/rpyc-3.3.0-py2.7.egg/rpyc/core/protocol.py", line 345, in _recv
    data = self._channel.recv()
File "/Library/Python/2.7/site-packages/rpyc-3.3.0-py2.7.egg/rpyc/core/channel.py", line 50, in recv
    header = self.stream.read(self.FRAME_HEADER.size)
File "/Library/Python/2.7/site-packages/rpyc-3.3.0-py2.7.egg/rpyc/core/stream.py", line 195, in read
    raise EOFError("connection closed by peer")
EOFError: connection closed by peer
Run Code Online (Sandbox Code Playgroud)