sockets - Python: zmq.error.ZMQError: Address already in use -


i've got virtually "hello world" server:

import time import zmq import mutagen import json  context = zmq.context() socket = context.socket(zmq.rep) socket.bind("tcp://*:64108")  try:      while true:         #  wait next request client         message = socket.recv()         jsn = message.decode('utf8')         rq = json.loads(jsn)          reply = 'idle'          if rq['request'] == 'settags':             audio = mutagen.file(rq['file'], easy=true)             if audio:                 reply = "track number set [{}]".format(rq['tags']['tracknumber'])  # debug info                 tag, value in rq['tags'].items():                     audio[tag] = value                 audio.save()         #  send reply client         socket.send_string(reply)  except keyboardinterrupt e:     sys.exit(e) 

any attempt first ends this, quite naturally:

$ python /home/alexey/dropbox/procrustes/procrserver.py  traceback (most recent call last):   file "/home/alexey/dropbox/procrustes/procrserver.py", line 20, in <module> socket.bind("tcp://*:64108")   file "zmq/backend/cython/socket.pyx", line 487, in zmq.backend.cython.socket.socket.bind (zmq/backend/cython/socket.c:5156)   file "zmq/backend/cython/checkrc.pxd", line 25, in zmq.backend.cython.checkrc._check_rc (zmq/backend/cython/socket.c:7535) zmq.error.zmqerror: address in use 

all want check address, kill abortive script, , rid of stack trace. somehow did not manage find usable answer. supposed do?


Comments

Popular posts from this blog

ruby - Trying to change last to "x"s to 23 -

jquery - Clone last and append item to closest class -

c - Unrecognised emulation mode: elf_i386 on MinGW32 -