The part: MySelectionKey selectionKey = new MySelectionKey(socketChannel); selectionKey.attach(nioSocketChannel); read(selectionKey);
is just dummy internal stuff. Pls. ignore it for this question. 2014-07-08 17:49 GMT+03:00 artemv zmq <[email protected]>: > hi > > I'm on java, using jzmq-3.2.2, and jni binding v3. Ran into troubles with > poller and its .register(SelectableChannel, int) function. The problem is > that target SelectableChannel once registered can render only one > occurrence of .pollin() == true. Despite the fact that my External > application bombarding this channel with messages. > > Here's my code: > > public void run() { > for (;;) { > ZMQ.Poller poller = new ZMQ.Poller(1); > int i = poller.register(socketChannel, POLLIN); > poller.poll(1000); > LOGGER.info("### poller.pollin(" + i + ")=" + poller.pollin(i)); > if (poller.pollin(i)) { > try { > MySelectionKey selectionKey = new MySelectionKey(socketChannel); > selectionKey.attach(nioSocketChannel); > read(selectionKey); > } catch (ZmqOpenAPINioWorkerException e) { > LOGGER.warn("### Fail: " + e, e); > } > } > } > } > > > So, I every time register socketChannel on new poller and polling it. > External client sending messages constantly, so I should get in my code > always poller.pollin(0) == true, but unfortunately I get this only once. > > > Any guideline would be much appreciated. > > Thanks. >
_______________________________________________ zeromq-dev mailing list [email protected] http://lists.zeromq.org/mailman/listinfo/zeromq-dev
