Hi,
I am using jeromq 0.3.0 an Java 1.7, Windows 7.
While I am using a blocking recv() with a defined timeout, my CPU is up
to 100%
Shouldn't a blocking receiver be easy on the CPU?
This is my code that represents the receiver part:
ZMQ.Socket subscriber = context.socket(ZMQ.SUB);
subscriber.setReceiveTimeOut(500);
subscriber.connect("tcp://10.183.14.66:5563");
subscriber.subscribe(messageType);
byte[] receiver = null;
while (!Thread.currentThread().isInterrupted()) {
try {
receiver = subscriber.recv();
} catch (ZMQException e) {
if (e.getErrorCode () == ZMQ.Error.ETERM.getCode ()) {
break;
}
}
if (receiver != null) {
// do stuff
}
subscriber.close();
Am I doing anything wrong here?
Thank you for any help,
-- Bernd
_______________________________________________
zeromq-dev mailing list
[email protected]
http://lists.zeromq.org/mailman/listinfo/zeromq-dev