[zeromq-dev] Problem on ARM platform
Michael Haberler
mail17 at mah.priv.at
Fri Apr 11 20:09:06 CEST 2014
David,
Am 11.04.2014 um 19:26 schrieb David Jagoe <davidjagoe at gmail.com>:
> Ahoy,
>
> I've got a simple program that works on my PC but not when I compile it on an ARM platform.
>
> In both cases I'm running on Linux (Ubuntu on my PC and Debian Wheezy on the ARM target).
>
> In both cases I have compiled the following versions of zmq:
>
> czmq-2.1.0.tar.gz
> zeromq-4.0.4.tar.gz
>
> python-zmq from ubuntu/debian repo respectively.
>
> Thanks for any help. Programs below:
>
>
> C program publishing data:
>
> #define THREAD_USE_POSIX
> #include <stdlib.h>
> #include <stdio.h>
> #include <time.h>
> #include "czmq.h"
>
> #define PUB_SOCKET_ADDRESS "ipc:///tmp/pub.ipc"
> #define TRUE 1
>
>
> void publish(void *socket) {
> while (TRUE) {
> sleep(1);
> zstr_send(socket, "hello 1 2");
----^^^^^^^^^ you dont give a topic - you would want to send a multipart message here: ["topic", "contents"]
try:
zstr_sendm (socket, "topic");
zstr_send(socket, "hello 1 2");
-m
> }
> }
>
>
> int main(int argc, char *argv[]) {
>
> zctx_t *context = zctx_new();
>
> void *socket = zsocket_new(context, ZMQ_PUB);
> zsocket_bind(socket, PUB_SOCKET_ADDRESS);
>
> publish(socket);
>
> }
>
>
> =====================
>
> Python program receiving:
>
>
> import zmq
> import time
>
> context = zmq.Context()
> socket = context.socket(zmq.SUB)
> socket.connect("ipc:///tmp/pub.ipc")
> # socket.connect("tcp://localhost:5556")
>
> socket.setsockopt(zmq.SUBSCRIBE, "")
>
> while True:
> print socket.recv()
>
>
>
> Both programs run fine but I get nothing printed in the python program when this is running on the ARM platform. The same code (and library versions) work fine on my PC.
>
> Any suggestions?
>
>
> Thanks!
> David
>
>
>
> --
> David Jagoe
>
> davidjagoe at gmail.com
> +18053284389
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
More information about the zeromq-dev
mailing list