summaryrefslogtreecommitdiff
path: root/bindings/java/org/zmq/Context.java
diff options
context:
space:
mode:
Diffstat (limited to 'bindings/java/org/zmq/Context.java')
-rw-r--r--bindings/java/org/zmq/Context.java21
1 files changed, 19 insertions, 2 deletions
diff --git a/bindings/java/org/zmq/Context.java b/bindings/java/org/zmq/Context.java
index 1b5ecb4..7a3552b 100644
--- a/bindings/java/org/zmq/Context.java
+++ b/bindings/java/org/zmq/Context.java
@@ -26,6 +26,10 @@ public class Context {
public static final int POLL = 1;
+ public static final int POLLIN = 1;
+ public static final int POLLOUT = 2;
+ public static final int POLLERR = 4;
+
/**
* Class constructor.
*
@@ -36,6 +40,20 @@ public class Context {
construct (appThreads, ioThreads, flags);
}
+ /**
+ * Issue a poll call on the specified 0MQ sockets.
+ * This function is experimental and may change in the future.
+ *
+ * @param socket an array of 0MQ Socket objects to poll.
+ * @param event an array of short values specifying what to poll for.
+ * @param revent an array of short values with the results.
+ * @param timeout the maximum timeout in microseconds.
+ */
+ public native long poll (Socket[] socket,
+ short[] event,
+ short[] revent,
+ long timeout);
+
/** Initialize the JNI interface */
protected native void construct (int appThreads, int ioThreads, int flags);
@@ -50,10 +68,9 @@ public class Context {
* @return the internal 0MQ context handle.
*/
private long getContextHandle () {
- return contextHandle;
+ return contextHandle;
}
-
/** Opaque data used by JNI driver. */
private long contextHandle;
}