|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.zeromq.ZMQ.Poller
public static class ZMQ.Poller
Inner class: Poller.
Field Summary | |
---|---|
static int |
POLLERR
|
static int |
POLLIN
These values can be ORed to specify what we want to poll for. |
static int |
POLLOUT
|
Constructor Summary | |
---|---|
|
ZMQ.Poller(int size)
Constructor |
protected |
ZMQ.Poller(ZMQ.Context context)
Class constructor. |
protected |
ZMQ.Poller(ZMQ.Context context,
int size)
Class constructor. |
Method Summary | |
---|---|
ZMQ.PollItem |
getItem(int index)
Get the PollItem associated with an index. |
int |
getNext()
Get the index for the next position in the poll set size. |
int |
getSize()
Get the current poll set size. |
ZMQ.Socket |
getSocket(int index)
Get the socket associated with an index. |
long |
getTimeout()
Deprecated. Timeout handling has been moved to the poll() methods. |
long |
poll()
Issue a poll call. |
int |
poll(long tout)
Issue a poll call, using the specified timeout value. |
boolean |
pollerr(int index)
Check whether the specified element in the poll set was signalled for error. |
boolean |
pollin(int index)
Check whether the specified element in the poll set was signalled for input. |
boolean |
pollout(int index)
Check whether the specified element in the poll set was signalled for output. |
int |
register(SelectableChannel channel)
Register a Channel for polling on all events. |
int |
register(SelectableChannel channel,
int events)
Register a Channel for polling on the specified events. |
int |
register(ZMQ.PollItem item)
Register a Channel for polling on the specified events. |
int |
register(ZMQ.Socket socket)
Register a Socket for polling on all events. |
int |
register(ZMQ.Socket socket,
int events)
Register a Socket for polling on the specified events. |
protected static int |
run_poll(ZMQ.PollItem[] items,
int count,
long timeout)
Issue a poll call on the specified 0MQ items. |
void |
setTimeout(long timeout)
Deprecated. Timeout handling has been moved to the poll() methods. |
void |
unregister(SelectableChannel channel)
Unregister a Channel for polling on the specified events. |
void |
unregister(ZMQ.Socket socket)
Unregister a Socket for polling on the specified events. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int POLLIN
public static final int POLLOUT
public static final int POLLERR
Constructor Detail |
---|
public ZMQ.Poller(int size)
size
- the number of Sockets this poller will contain.protected ZMQ.Poller(ZMQ.Context context)
context
- a 0MQ context previously created.protected ZMQ.Poller(ZMQ.Context context, int size)
context
- a 0MQ context previously created.size
- the number of Sockets this poller will contain.Method Detail |
---|
public int register(ZMQ.Socket socket)
socket
- the Socket we are registering.
public int register(SelectableChannel channel)
channel
- the Channel we are registering.
public int register(ZMQ.Socket socket, int events)
socket
- the Socket we are registering.events
- a mask composed by XORing POLLIN, POLLOUT and POLLERR.
public int register(SelectableChannel channel, int events)
socket
- the Channel we are registering.events
- a mask composed by XORing POLLIN, POLLOUT and POLLERR.
public int register(ZMQ.PollItem item)
item
- the PollItem we are registering.
public void unregister(ZMQ.Socket socket)
socket
- the Socket to be unregisteredpublic void unregister(SelectableChannel channel)
socket
- the Channel to be unregisteredpublic ZMQ.Socket getSocket(int index)
index
- the desired index.
public ZMQ.PollItem getItem(int index)
index
- the desired index.
public long getTimeout()
public void setTimeout(long timeout)
timeout
- the desired poll timeout in microseconds.public int getSize()
public int getNext()
public long poll()
public int poll(long tout)
Since ZeroMQ 3.0, the timeout parameter is in milliseconds, but prior to this the unit was microseconds.
tout
- the timeout, as per zmq_poll (); if -1, it will block indefinitely until an event happens; if 0,
it will return immediately; otherwise, it will wait for at most that many
milliseconds/microseconds (see above).
http://api.zeromq.org/2-1:zmq-poll
,
http://api.zeromq.org/3-0:zmq-poll
public boolean pollin(int index)
index
-
public boolean pollout(int index)
index
-
public boolean pollerr(int index)
index
-
protected static int run_poll(ZMQ.PollItem[] items, int count, long timeout)
Since ZeroMQ 3.0, the timeout parameter is in milliseconds, but prior to this the unit was microseconds.
items
- an array of PollItem to poll.timeout
- the maximum timeout in milliseconds/microseconds (see above).
http://api.zeromq.org/2-1:zmq-poll
,
http://api.zeromq.org/3-0:zmq-poll
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |