[zeromq-dev] python binding, REQ/REP blocking, apparent "deadlock"
Brian Granger
ellisonbg at gmail.com
Sun Oct 17 06:38:31 CEST 2010
I have actually not used zeromq or pyzmq in really long connections
like you are describing, but I think some others here have reported
issues with that. You might poke around the list archives for threads
on this topic.
Cheers,
Brian
On Thu, Oct 14, 2010 at 3:30 PM, George Coles
<george.coles at quantitative.com> wrote:
> Hi,
>
> I have basically been lurking during the last few months of feverish
> activity on this list. I decided to use zmq for a very simple application
> that is basically one step above hello world, thinking that not much would
> probably go wrong. I am using the 2.0.7 python binding, with v 2.0.7 of the
> core. The client is 64-bit windows, the server is 64-bit debian 5 lenny. The
> code below is very close to the literal truth. After I start my client, it
> sends several hundred messages in a few seconds. All seem to go as expected,
> and no messages are missing on the server side. After an hour or two of
> inactivity, another single message is sent. This message never gets a reply
> when sent by the client. I kill the client after a while of waiting, and at
> this point, the message that was sent to the server comes "unstuck" and is
> sent on for processing. This is all REQ/REP, and I am neither getting an
> error from either the server or the client that the connection is closed,
> nor am I getting an illegal state error as if the req/rep sequence was
> violated. I can't tell if this issue is random, or whether it is as a result
> somehow of the length of time the socket is connected. Has anyone eny
> experience like this? I did not find any issues entered that matched this
> kind of problem. I would upgrade to the lastest versions but things seem to
> change very quickly,and I do not find any bugs entered that match my
> experience.
>
>
>
> thx
>
> George
>
>
>
> #client
>
> ctx = ZMQ.context(1)
>
> fixMsgsSckt = ctx.socket(ZMQ.REQ)
>
> fixMsgsSckt.connect("tcp://hooha:8080")
>
>
>
> while True:
>
> success = fixMsgsSckt.send(s)
>
> print "sent message successed:" + str(success)
>
> fixMsgsSckt.recv()
>
> print "got resp"
>
>
>
> #server
>
> ctxIn = zmq.Context(1)
>
> replySocket = ctxIn.socket(zmq.REP)
>
> print 'about to bind on ' + incomingUrl
>
> replySocket.bind(incomingUrl)
>
>
>
> while True:
>
> #print 'waiting for msg'
>
> msg = replySocket.recv()
>
> #print 'got msg '
>
> replySocket.send('')
>
> #print str(msg)
>
>
>
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
>
>
--
Brian E. Granger, Ph.D.
Assistant Professor of Physics
Cal Poly State University, San Luis Obispo
bgranger at calpoly.edu
ellisonbg at gmail.com
More information about the zeromq-dev
mailing list