[zeromq-dev] JeroMQ subscriber doesn't work
Ole Jørgen Legård
olejl77 at gmail.com
Mon Nov 24 20:09:12 CET 2014
Hi
I'm trying to use JeroMQ in an android application to subscribe to events
(pusblish) done on another computer on the LAN. The problem is that the
android application doesn't receive anything.
Other application on my computer using C# and NetMQ works fine.
Here is the setup of the subscriber:
class ZeroMQThread extends Thread
{
private static final String INNER_TAG = "ZeroMQThread";
public void run() {
this.setName(INNER_TAG);
ZMQ.Context context = ZMQ.context(1);
ZMQ.Socket subscriber = context.socket(ZMQ.SUB);
String connectTo = "tcp://10.200.20.10:5558";
subscriber.connect(connectTo);
subscriber.subscribe(ZMQ.SUBSCRIPTION_ALL);
while (mIsServiceRunning) {
byte[] msg = subscriber.recv(0);
Log.d(INNER_TAG, msg.toString());
}
subscriber.close ();
context.term ();
}
}
It never returns from subscriber.recv(0). What could I be doing wrong? The
publisher is running ZeroMQ 4.0.3.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20141124/0620df81/attachment.htm>
More information about the zeromq-dev
mailing list