Hello ZMQ,

Using Android Studio, and the jeromq-0.3.5.jar library, I am attempting to
build a mobile application that will subscribe to a publisher that is
dumping string messages.

Here is what my code looks like on the Subscriber side:

Runnable runnable = new Runnable()
        {
            public void run()
            {
              ZMQ.Context context = ZMQ.context(1);
              ZMQ.Socket subscriber = context.socket(ZMQ.SUB);


*SocketBase socketBase = null;*

*              zmq.ZMQ.setSocketOption(socketBase, zmq.ZMQ.ZMQ_SUBSCRIBE, " ");*

              subscriber.connect("tcp://192.168.1.36:6666");
              String testcase = subscriber.recvStr(0);
              TextView strDisplay = (TextView) findViewById(R.id.stringDisplay);
              Log.i("Output", "the testcase recieved something");
              strDisplay.setText(testcase);
              Log.i("Output", "strDisplay was set");
            }
        };


I am having an issue with the lines I highlighted in bold. I don't fully
understand the role of SocketBase and how to set the parameters of
setSocketOptions (analagous to zmq_setsockopt?). I am attempting to read
all string messages of any size from a publisher. In any case, right now I
am getting an IllegalStateException error for the setSocketOption line.

Thank you.
_______________________________________________
zeromq-dev mailing list
[email protected]
http://lists.zeromq.org/mailman/listinfo/zeromq-dev

Reply via email to