4
我正在做一個簡單的服務器/客戶端連接使用python 2.7中的多處理。
當我在一個單獨的python shell中運行客戶端代碼時,連接成功,但是當我作爲一個整體運行應用程序時,出現「socket.error:[Errno 111] Connection refused」。python multiprocessing socket.error:[Errno 111]連接被拒絕?
這是回溯:
Traceback (most recent call last):
File "./kaboom", line 276, in <module>
sequence.run(testEnv)
File "/e/m/amoreau/test_edit/kaboom/src/kbmSequence.py", line 271, in run
if testEnv.open() != SUCCESS:
File "/e/m/amoreau/test_edit/kaboom/src/kbmTestEnv.py", line 518, in open
queueManager = resultsClient.QueueServerClient()
File "/e/m/amoreau/test_edit/kaboom/resultsClient.py", line 15, in QueueServerClient
manager.connect()
File "/usr/lib64/python2.6/multiprocessing/managers.py", line 474, in connect
conn = Client(self._address, authkey=self._authkey)
File "/usr/lib64/python2.6/multiprocessing/connection.py", line 143, in Client
c = SocketClient(address)
File "/usr/lib64/python2.6/multiprocessing/connection.py", line 263, in SocketClient
s.connect(address)
File "<string>", line 1, in connect
socket.error: [Errno 111] Connection refused
爲什麼會出現這種情況?我禁用了所有的防火牆。
您可以舉一個簡短的代碼示例嗎? –