[zeromq-dev] Fwd: Problem with IPC
Oliver Smith
oliver at kfs.org
Wed Jul 28 17:20:08 CEST 2010
I also managed to bury this didn't I? :)
- Oliver
-------- Original Message --------
Subject: [zeromq-dev] Problem with IPC
Date: Mon, 26 Jul 2010 02:05:44 -0500
From: Oliver Smith <oliver at kfs.org>
Reply-To: 0MQ development list <zeromq-dev at lists.zeromq.org>
To: 0MQ development list <zeromq-dev at lists.zeromq.org>
If an UPSTREAM connects to an IPC socket that has already had data sent,
it will not receive the first message sent after connection:
Given the following upstream:
[lua]
require 'zmq' ; ctx = zmq.init(1) ; s = ctx:socket(zmq.UPSTREAM) ;
s:connect("ipc:///tmp/zmqdemo")
s:recv()
[python]
import zmq ; ctx = zmq.Cotnext() ; s = ctx.socket(zmq.UPSTREAM) ;
s.connect("ipc:///tmp/zmqdemo")
s.recv()
If you now start a downstream in an interpreter
[lua]
require 'zmq' ; ctx = zmq.init(1) ; s = ctx:socket(zmq.DOWNSTREAM)
; s:bind("ipc:///tmp/zmqdemo")
s:send("Hello")
-- restart the upstream
s:send("blah")
-- wait a few moments
s:send("World")
[python]
import zmq ; ctx = zmq.Context() ; s = ctx.socket(zmq.DOWNSTREAM) ;
s.bind("ipc:///tmp/zmqdemo")
s.send("Hello")
-- restart the upstream
s.send("blah")
-- wait a few moments
s.send("World")
The second upstream won't see the "blah" message but it will see the
"World" message.
Note: the "blah" is only being sent /after/ the first upstream has
closed and the second upstream has connected.
Even adding an explicit s:close() / s.close() does not fix this.
- Oliver
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20100728/32ca3ff2/attachment.htm>
More information about the zeromq-dev
mailing list