Python &引用;“正在使用的地址”;在尝试创建子进程时

Python &引用;“正在使用的地址”;在尝试创建子进程时,python,multiprocessing,zeromq,Python,Multiprocessing,Zeromq,我正在使用ZMQ在python上编写服务器,我想在单独的进程中绘制绘图,但在process.start()之后,我得到一个错误“ZMQERRor:Address in use”。我怎样才能修好它?为什么子进程尝试连接到同一地址,尽管它不包含任何与连接相关的内容 import zmq import multiprocessing as mp class Server: def __init__(self,host,port): self.context = zmq.Con

我正在使用ZMQ在python上编写服务器,我想在单独的进程中绘制绘图,但在
process.start()
之后,我得到一个错误
“ZMQERRor:Address in use”
。我怎样才能修好它?为什么子进程尝试连接到同一地址,尽管它不包含任何与连接相关的内容

import zmq
import multiprocessing as mp

class Server:
    def __init__(self,host,port):
        self.context = zmq.Context()
        self.sock = self.context.socket(zmq.REP)
        self.sock.bind('tcp://'+host+':'+str(port))
        print 'Listening port :',port
        #--child-process---- 
        vis = Visualiser()
        proc1 = mp.Process(target=vis.show)
        proc1.start()

class Visualiser:
    def show(self):
        print 'something'

srv = Server('127.0.0.1', 1111)

如果您希望获得解决问题的帮助,请发布一些代码来重现该问题。如果重新启动会发生什么?@CristianCiupitu无任何更改我在Fedora 20 x86_64上没有收到任何错误,该软件使用python-2.7.5-11和python-zmq-13.0.2-1。您发布的代码对我来说是有效的,不会重现该错误。通常,当您得到一个已经在使用的错误
地址时
,您只需终止Python进程并重新启动脚本。