[zeromq-dev] Confusion in the parallel pipe example

2013-04-09 Thread Pritesh Acharya
In the parallel pipe example,

zmq_bind (sender, tcp://*:5557);

zmq_connect (sink, tcp://localhost:5558);

and s_send (sink, 0);

s_send (sender, string);

how does the control continues in the first s_send and block on the second
s_send, when I haven't started sink on 5558 port.

?
___
zeromq-dev mailing list
zeromq-dev@lists.zeromq.org
http://lists.zeromq.org/mailman/listinfo/zeromq-dev


Re: [zeromq-dev] Confusion in the parallel pipe example

2013-04-09 Thread Pieter Hintjens
Hi Pritesh,

You're talking about the task ventilator?

The second send doesn't block. The task pipeline can be a little
puzzling at first; best thing is to draw the design on paper and try
to understand the message flow from piece to piece.

-Pieter



On Tue, Apr 9, 2013 at 9:56 AM, Pritesh Acharya
priteshacha...@gmail.com wrote:
 In the parallel pipe example,

 zmq_bind (sender, tcp://*:5557);

 zmq_connect (sink, tcp://localhost:5558);

 and s_send (sink, 0);

 s_send (sender, string);

 how does the control continues in the first s_send and block on the second
 s_send, when I haven't started sink on 5558 port.

 ?


 ___
 zeromq-dev mailing list
 zeromq-dev@lists.zeromq.org
 http://lists.zeromq.org/mailman/listinfo/zeromq-dev

___
zeromq-dev mailing list
zeromq-dev@lists.zeromq.org
http://lists.zeromq.org/mailman/listinfo/zeromq-dev


[zeromq-dev] pushpin

2013-04-09 Thread Justin Karneges
Hi people,

My Pushpin project seems to be getting a lot of attention on HackerNews:
https://news.ycombinator.com/item?id=5516568

I just wanted to mention that under the hood it's a multiprocess ZeroMQ 
architecture. Thanks again for the nice lib. :)

Justin
___
zeromq-dev mailing list
zeromq-dev@lists.zeromq.org
http://lists.zeromq.org/mailman/listinfo/zeromq-dev


Re: [zeromq-dev] Problems cross compiling for ARM

2013-04-09 Thread Martin Lucina
Hi Michael,

mwpowell...@gmail.com said:
 Hello,
 
 I want to build ZMQ for ARM but have problems.
 
 If I just build with the plain old i386 arch, no problems. I do get a .a
 library I can statically link against, BTW. Good.
 
 Now if I ./configure ... CC=arm-none-linux-gnueabi-gcc --host=arm
 
 It builds, but the output files are still targeting 80386. This isn't right?
 
 How do we build for ARM?

You want:

$ ./configure --host=arm-none-linux-gnueabi

Cheers,

-mato
___
zeromq-dev mailing list
zeromq-dev@lists.zeromq.org
http://lists.zeromq.org/mailman/listinfo/zeromq-dev


[zeromq-dev] ESTABLISHED connection mismatch

2013-04-09 Thread Garrett Smith
I don't know if this is a 0MQ question or a general networking
question. I know that I'm confused.

I'm troubleshooting some message delivery problems and I've run across
this scenario:

The ESTABLISHED tcp connections on one server don't match the
corresponding connections on the other server. I'll call one server
router-server and the other dealer-server (corresponding to the
role and 0MQ socket type one each server).

On the router-server I see these connections to the dealer-server:

tcp0  0 192.168.1.10:1234 192.168.1.11:52726 ESTABLISHED
tcp0  0 192.168.1.10:1234 192.168.1.11:42556 ESTABLISHED
tcp0  0 192.168.1.10:1234 192.168.1.11:52728 ESTABLISHED
tcp0  0 192.168.1.10:1234 192.168.1.11:42774 ESTABLISHED
tcp0  0 192.168.1.10:1234 192.168.1.11:52727 ESTABLISHED
tcp0  0 192.168.1.10:1234 192.168.1.11:42563 ESTABLISHED

On the dealer-server I see these to the router-server:

tcp0  0 192.168.1.11:52728 192.168.1.10:1234 ESTABLISHED
tcp0  0 192.168.1.11:42563 192.168.1.10:1234 ESTABLISHED
tcp0  0 192.168.1.11:42556 192.168.1.10:1234 ESTABLISHED

These were listed by netstat -na on the respective servers at the same time.

This scenario seems to only apply to the problem connection -- the
non-problem router/dealer server pairs have the expected one-to-one
established connections.

Garrett
___
zeromq-dev mailing list
zeromq-dev@lists.zeromq.org
http://lists.zeromq.org/mailman/listinfo/zeromq-dev


Re: [zeromq-dev] Problems cross compiling for ARM

2013-04-09 Thread Martin Lucina
 Unfortunately not, see above. E.g. I have arm-linux-gnueabi here since I
 use the EmDebian toolchain.

FYI, I couldn't get zeromq-3.2.2 to compile using my toolchain (Debian
4.4.5-8) due to a bug in decoder.hpp.  Fixed the bug myself and was going
to submit a patch but this appears to have been fixed since in commit
6d4e2ce to zeromq3-x.

-mato
___
zeromq-dev mailing list
zeromq-dev@lists.zeromq.org
http://lists.zeromq.org/mailman/listinfo/zeromq-dev


Re: [zeromq-dev] Sending via ROUTER socket to ROUTER socket fails initially with No route to host

2013-04-09 Thread Anoop Karollil
Thanks Pieter. Does the hand shaking happen at connect? Because suppose 
there is a delay after the connect, before the initial send, the send 
succeeds.

If the handshaking does happen at connect, and if it is possible to make 
sure the connect returns only after the handshaking is done, that would 
fix the weird behaviour. Of course it is weird only when you expect a 
successful connect to indicate 'pipe' established and the ability to 
send successfully after.

But I am guessing since the connect should succeed even if the peer 
hasn't bound, it would be hard to wait till the handshake happens, as it 
could potentially take forever.

Anoop

Pieter Hintjens wrote:
 OK, we found it. There is some internal handshaking before a message
 can be routed, even if the ROUTER socket connects out. There's no way
 for libzmq to know the identity of the peer until it receives the
 identity from the peer.

 ROUTER pipes are created only for known identities, i.e. for a peer
 that has sent us its identity, no matter who connected to whom.

 We could force pipe creation in some way but it would require changes.

 Hope this helps.

 -Pieter

 On Fri, Apr 5, 2013 at 11:13 PM, Anoop Karollil
 anoop.karol...@gmail.com wrote:
 Pieter Hintjens wrote:

 On Mon, Apr 1, 2013 at 6:23 PM, Anoop Karollil anoop.karol...@gmail.com
 wrote:

 Pieter, any clue as to why the send with the connected (not bound)
 ROUTER socket might be failing initially?


 No clue, but if you can make a minimal test case in C, we can
 investigate. Afaik it should work and this would be considered a bug.


 Attached are two C programs that reproduce the problem. The broker binds and
 receives. The client connects and then sends. The send fails initially and
 then succeeds.
___
zeromq-dev mailing list
zeromq-dev@lists.zeromq.org
http://lists.zeromq.org/mailman/listinfo/zeromq-dev


Re: [zeromq-dev] ESTABLISHED connection mismatch

2013-04-09 Thread Michel Pelletier
Is there NATing between these two hosts? RFC 5382 has some guidelines on
idle timeout for established connections, you might be hitting that limit.

-Michel


On Tue, Apr 9, 2013 at 9:36 AM, Garrett Smith g...@rre.tt wrote:

 I don't know if this is a 0MQ question or a general networking
 question. I know that I'm confused.

 I'm troubleshooting some message delivery problems and I've run across
 this scenario:

 The ESTABLISHED tcp connections on one server don't match the
 corresponding connections on the other server. I'll call one server
 router-server and the other dealer-server (corresponding to the
 role and 0MQ socket type one each server).

 On the router-server I see these connections to the dealer-server:

 tcp0  0 192.168.1.10:1234 192.168.1.11:52726
 ESTABLISHED
 tcp0  0 192.168.1.10:1234 192.168.1.11:42556
 ESTABLISHED
 tcp0  0 192.168.1.10:1234 192.168.1.11:52728
 ESTABLISHED
 tcp0  0 192.168.1.10:1234 192.168.1.11:42774
 ESTABLISHED
 tcp0  0 192.168.1.10:1234 192.168.1.11:52727
 ESTABLISHED
 tcp0  0 192.168.1.10:1234 192.168.1.11:42563
 ESTABLISHED

 On the dealer-server I see these to the router-server:

 tcp0  0 192.168.1.11:52728 192.168.1.10:1234
 ESTABLISHED
 tcp0  0 192.168.1.11:42563 192.168.1.10:1234
 ESTABLISHED
 tcp0  0 192.168.1.11:42556 192.168.1.10:1234
 ESTABLISHED

 These were listed by netstat -na on the respective servers at the same
 time.

 This scenario seems to only apply to the problem connection -- the
 non-problem router/dealer server pairs have the expected one-to-one
 established connections.

 Garrett
 ___
 zeromq-dev mailing list
 zeromq-dev@lists.zeromq.org
 http://lists.zeromq.org/mailman/listinfo/zeromq-dev

___
zeromq-dev mailing list
zeromq-dev@lists.zeromq.org
http://lists.zeromq.org/mailman/listinfo/zeromq-dev


Re: [zeromq-dev] ESTABLISHED connection mismatch

2013-04-09 Thread Garrett Smith
No NATing that I'm aware of. But this is EC2, so there could be
shenanigans afoot. (Shenanigans btw, is the most advanced descriptor
in my network layer vocabulary.)

The 6 established connections on the router-server are still shown
via netstat -- even after these many hours have passed. If there's a
timeout in play, it's quite long.

On Tue, Apr 9, 2013 at 3:54 PM, Michel Pelletier
pelletier.mic...@gmail.com wrote:
 Is there NATing between these two hosts? RFC 5382 has some guidelines on
 idle timeout for established connections, you might be hitting that limit.

 -Michel


 On Tue, Apr 9, 2013 at 9:36 AM, Garrett Smith g...@rre.tt wrote:

 I don't know if this is a 0MQ question or a general networking
 question. I know that I'm confused.

 I'm troubleshooting some message delivery problems and I've run across
 this scenario:

 The ESTABLISHED tcp connections on one server don't match the
 corresponding connections on the other server. I'll call one server
 router-server and the other dealer-server (corresponding to the
 role and 0MQ socket type one each server).

 On the router-server I see these connections to the dealer-server:

 tcp0  0 192.168.1.10:1234 192.168.1.11:52726
 ESTABLISHED
 tcp0  0 192.168.1.10:1234 192.168.1.11:42556
 ESTABLISHED
 tcp0  0 192.168.1.10:1234 192.168.1.11:52728
 ESTABLISHED
 tcp0  0 192.168.1.10:1234 192.168.1.11:42774
 ESTABLISHED
 tcp0  0 192.168.1.10:1234 192.168.1.11:52727
 ESTABLISHED
 tcp0  0 192.168.1.10:1234 192.168.1.11:42563
 ESTABLISHED

 On the dealer-server I see these to the router-server:

 tcp0  0 192.168.1.11:52728 192.168.1.10:1234
 ESTABLISHED
 tcp0  0 192.168.1.11:42563 192.168.1.10:1234
 ESTABLISHED
 tcp0  0 192.168.1.11:42556 192.168.1.10:1234
 ESTABLISHED

 These were listed by netstat -na on the respective servers at the same
 time.

 This scenario seems to only apply to the problem connection -- the
 non-problem router/dealer server pairs have the expected one-to-one
 established connections.

 Garrett
 ___
 zeromq-dev mailing list
 zeromq-dev@lists.zeromq.org
 http://lists.zeromq.org/mailman/listinfo/zeromq-dev



 ___
 zeromq-dev mailing list
 zeromq-dev@lists.zeromq.org
 http://lists.zeromq.org/mailman/listinfo/zeromq-dev

___
zeromq-dev mailing list
zeromq-dev@lists.zeromq.org
http://lists.zeromq.org/mailman/listinfo/zeromq-dev


Re: [zeromq-dev] ESTABLISHED connection mismatch

2013-04-09 Thread Michel Pelletier
Are you using their VPC technology or talking over elastic IPs?  The
elastic IP stuff does seem to involve some shenanigans, in that it must
forward or somehow bind the public ip to the internal one.  If you use VPC,
I don't think there's that translation layer involved.

Other than that, I'm out of ideas. :)

-Michel


On Tue, Apr 9, 2013 at 2:51 PM, Garrett Smith g...@rre.tt wrote:

 No NATing that I'm aware of. But this is EC2, so there could be
 shenanigans afoot. (Shenanigans btw, is the most advanced descriptor
 in my network layer vocabulary.)

 The 6 established connections on the router-server are still shown
 via netstat -- even after these many hours have passed. If there's a
 timeout in play, it's quite long.

 On Tue, Apr 9, 2013 at 3:54 PM, Michel Pelletier
 pelletier.mic...@gmail.com wrote:
  Is there NATing between these two hosts? RFC 5382 has some guidelines on
  idle timeout for established connections, you might be hitting that
 limit.
 
  -Michel
 
 
  On Tue, Apr 9, 2013 at 9:36 AM, Garrett Smith g...@rre.tt wrote:
 
  I don't know if this is a 0MQ question or a general networking
  question. I know that I'm confused.
 
  I'm troubleshooting some message delivery problems and I've run across
  this scenario:
 
  The ESTABLISHED tcp connections on one server don't match the
  corresponding connections on the other server. I'll call one server
  router-server and the other dealer-server (corresponding to the
  role and 0MQ socket type one each server).
 
  On the router-server I see these connections to the dealer-server:
 
  tcp0  0 192.168.1.10:1234 192.168.1.11:52726
  ESTABLISHED
  tcp0  0 192.168.1.10:1234 192.168.1.11:42556
  ESTABLISHED
  tcp0  0 192.168.1.10:1234 192.168.1.11:52728
  ESTABLISHED
  tcp0  0 192.168.1.10:1234 192.168.1.11:42774
  ESTABLISHED
  tcp0  0 192.168.1.10:1234 192.168.1.11:52727
  ESTABLISHED
  tcp0  0 192.168.1.10:1234 192.168.1.11:42563
  ESTABLISHED
 
  On the dealer-server I see these to the router-server:
 
  tcp0  0 192.168.1.11:52728 192.168.1.10:1234
  ESTABLISHED
  tcp0  0 192.168.1.11:42563 192.168.1.10:1234
  ESTABLISHED
  tcp0  0 192.168.1.11:42556 192.168.1.10:1234
  ESTABLISHED
 
  These were listed by netstat -na on the respective servers at the same
  time.
 
  This scenario seems to only apply to the problem connection -- the
  non-problem router/dealer server pairs have the expected one-to-one
  established connections.
 
  Garrett
  ___
  zeromq-dev mailing list
  zeromq-dev@lists.zeromq.org
  http://lists.zeromq.org/mailman/listinfo/zeromq-dev
 
 
 
  ___
  zeromq-dev mailing list
  zeromq-dev@lists.zeromq.org
  http://lists.zeromq.org/mailman/listinfo/zeromq-dev
 
 ___
 zeromq-dev mailing list
 zeromq-dev@lists.zeromq.org
 http://lists.zeromq.org/mailman/listinfo/zeromq-dev

___
zeromq-dev mailing list
zeromq-dev@lists.zeromq.org
http://lists.zeromq.org/mailman/listinfo/zeromq-dev


[zeromq-dev] DEALER and ROUTER to send and receive

2013-04-09 Thread Rahul Piyali Ray
Hi Gurus,
I have implemented a dealer (server) and router ( as server) using zmq.
I would like my application to use dealer or router to both send and
receive messages, something like a dealer can send and receive message. Is
this possible ? Please see the code that I have written. This works for one
way connection ( dealer sends, router receives). But I want it both
ways...dealer to receive from router on the same port over the network. Can
you please help me find what I am missing ?

Thanks,
Tufan

code:

int MessageClient::SendMessage(liststring stringList)
181 {
182
183 int returnvalue = -1;
184 int count = stringList.size();
185 for(liststring::const_iterator sitterator =
stringList.begin();
186 sitterator != stringList.end();  sitterator++)
187 {
188 string stringName = *sitterator;
189 int length = stringName.length();
190 int flag = count - 1;
191 count--;
192 void* value = stringName;
193 printf(message is %s, stringName);
194 if(flag  0)
195 returnvalue = zmq_send(socket, value, length,
PM_SNDMORE);
196 else
197 returnvalue = zmq_send(socket, value, length, flag);
198
199 assert (returnvalue == 1);
200 }
201 return returnvalue;
202 }


   char* MessageClient::ReceiveMessage( int flags)
219 {
220 zmq_msg_t zmqMessage;
221 zmq_msg_init(zmqMessage);
222 int size = zmq_msg_recv(zmqMessage,socket,flags);
223 if(size == -1)
224 {
225 printf( no message);
226 return (NULL);
227 }
228 char *string = (char *)malloc(size + 1);
229 memcpy(string, zmq_msg_data(zmqMessage), size);
230 zmq_msg_close(zmqMessage);
231 string[size] = 0;
232 return string;
233 }
234
___
zeromq-dev mailing list
zeromq-dev@lists.zeromq.org
http://lists.zeromq.org/mailman/listinfo/zeromq-dev


Re: [zeromq-dev] DEALER and ROUTER to send and receive

2013-04-09 Thread A. Mark
It is difficult to help without understanding more detail about your
application, in general yes you can send/recv in any order on router/dealer.


On Tue, Apr 9, 2013 at 3:38 PM, Rahul  Piyali Ray 8429oakm...@gmail.comwrote:

 Hi Gurus,
 I have implemented a dealer (server) and router ( as server) using
 zmq. I would like my application to use dealer or router to both send and
 receive messages, something like a dealer can send and receive message. Is
 this possible ? Please see the code that I have written. This works for one
 way connection ( dealer sends, router receives). But I want it both
 ways...dealer to receive from router on the same port over the network. Can
 you please help me find what I am missing ?

 Thanks,
 Tufan

 code:

 int MessageClient::SendMessage(liststring stringList)
 181 {
 182
 183 int returnvalue = -1;
 184 int count = stringList.size();
 185 for(liststring::const_iterator sitterator =
 stringList.begin();
 186 sitterator != stringList.end();  sitterator++)
 187 {
 188 string stringName = *sitterator;
 189 int length = stringName.length();
 190 int flag = count - 1;
 191 count--;
 192 void* value = stringName;
 193 printf(message is %s, stringName);
 194 if(flag  0)
 195 returnvalue = zmq_send(socket, value, length,
 PM_SNDMORE);
 196 else
 197 returnvalue = zmq_send(socket, value, length, flag);
 198
 199 assert (returnvalue == 1);
 200 }
 201 return returnvalue;
 202 }


char* MessageClient::ReceiveMessage( int flags)
 219 {
 220 zmq_msg_t zmqMessage;
 221 zmq_msg_init(zmqMessage);
 222 int size = zmq_msg_recv(zmqMessage,socket,flags);
 223 if(size == -1)
 224 {
 225 printf( no message);
 226 return (NULL);
 227 }
 228 char *string = (char *)malloc(size + 1);
 229 memcpy(string, zmq_msg_data(zmqMessage), size);
 230 zmq_msg_close(zmqMessage);
 231 string[size] = 0;
 232 return string;
 233 }
 234




 ___
 zeromq-dev mailing list
 zeromq-dev@lists.zeromq.org
 http://lists.zeromq.org/mailman/listinfo/zeromq-dev


___
zeromq-dev mailing list
zeromq-dev@lists.zeromq.org
http://lists.zeromq.org/mailman/listinfo/zeromq-dev


Re: [zeromq-dev] DEALER and ROUTER to send and receive

2013-04-09 Thread Lucas Hope
The router has to receive a message from the dealer first, so the return
envelope/s can be determined. After that, I don't think there are any
restrictions.


On Wed, Apr 10, 2013 at 1:06 PM, A. Mark gougol...@gmail.com wrote:

 It is difficult to help without understanding more detail about your
 application, in general yes you can send/recv in any order on router/dealer.


 On Tue, Apr 9, 2013 at 3:38 PM, Rahul  Piyali Ray 
 8429oakm...@gmail.comwrote:

 Hi Gurus,
 I have implemented a dealer (server) and router ( as server) using
 zmq. I would like my application to use dealer or router to both send and
 receive messages, something like a dealer can send and receive message. Is
 this possible ? Please see the code that I have written. This works for one
 way connection ( dealer sends, router receives). But I want it both
 ways...dealer to receive from router on the same port over the network. Can
 you please help me find what I am missing ?

 Thanks,
 Tufan

 code:

 int MessageClient::SendMessage(liststring stringList)
 181 {
 182
 183 int returnvalue = -1;
 184 int count = stringList.size();
 185 for(liststring::const_iterator sitterator =
 stringList.begin();
 186 sitterator != stringList.end();  sitterator++)
 187 {
 188 string stringName = *sitterator;
 189 int length = stringName.length();
 190 int flag = count - 1;
 191 count--;
 192 void* value = stringName;
 193 printf(message is %s, stringName);
 194 if(flag  0)
 195 returnvalue = zmq_send(socket, value, length,
 PM_SNDMORE);
 196 else
 197 returnvalue = zmq_send(socket, value, length, flag);
 198
 199 assert (returnvalue == 1);
 200 }
 201 return returnvalue;
 202 }


char* MessageClient::ReceiveMessage( int flags)
 219 {
 220 zmq_msg_t zmqMessage;
 221 zmq_msg_init(zmqMessage);
 222 int size = zmq_msg_recv(zmqMessage,socket,flags);
 223 if(size == -1)
 224 {
 225 printf( no message);
 226 return (NULL);
 227 }
 228 char *string = (char *)malloc(size + 1);
 229 memcpy(string, zmq_msg_data(zmqMessage), size);
 230 zmq_msg_close(zmqMessage);
 231 string[size] = 0;
 232 return string;
 233 }
 234




 ___
 zeromq-dev mailing list
 zeromq-dev@lists.zeromq.org
 http://lists.zeromq.org/mailman/listinfo/zeromq-dev



 ___
 zeromq-dev mailing list
 zeromq-dev@lists.zeromq.org
 http://lists.zeromq.org/mailman/listinfo/zeromq-dev




-- 
---
Dr Lucas Hope - lucas.r.hope@skype
Machine Learning and Software Engineering Consultant
Melbourne, Australia
___
zeromq-dev mailing list
zeromq-dev@lists.zeromq.org
http://lists.zeromq.org/mailman/listinfo/zeromq-dev