我关注this page上的rpyc教程,但在运行此代码时获取EOFError
bgsrv = rpyc.BgServingThread(conn) #creates a bg thread to process incoming events
我搜索了很多,但没有找到解决此问题的方法。 服务器和客户端在同一台机器上运行。我在macbook pro上运行脚本。 需要帮助来解决此错误。
您可以找到stream.py here的源代码。
这是追溯:
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