Modifier and Type | Field and Description |
---|---|
static int |
POLLERR |
static int |
POLLIN
These values can be ORed to specify what we want to poll for.
|
static int |
POLLOUT |
Modifier | Constructor and Description |
---|---|
|
Poller(int size) |
protected |
Poller(ZMQ.Context context)
Class constructor.
|
protected |
Poller(ZMQ.Context context,
int size)
Class constructor.
|
Modifier and Type | Method and Description |
---|---|
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.
|
int |
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 signaled for error.
|
boolean |
pollin(int index)
Check whether the specified element in the poll set was signaled for input.
|
boolean |
pollout(int index)
Check whether the specified element in the poll set was signaled for output.
|
int |
register(SelectableChannel channel,
int events)
Register a Socket 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.
|
void |
setTimeout(long timeout)
Deprecated.
Timeout handling has been moved to the poll() methods.
|
void |
unregister(SelectableChannel channel)
Unregister a Socket for polling on the specified events.
|
void |
unregister(ZMQ.Socket socket)
Unregister a Socket for polling on the specified events.
|
public static final int POLLIN
public static final int POLLOUT
public static final int POLLERR
public Poller(int size)
protected Poller(ZMQ.Context context, int size)
context
- a 0MQ context previously created.size
- the number of Sockets this poller will contain.protected Poller(ZMQ.Context context)
context
- a 0MQ context previously created.public int register(ZMQ.Socket socket)
socket
- the Socket 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)
channel
- 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)
channel
- the Socket to be unregisteredpublic ZMQ.PollItem getItem(int index)
index
- the desired index.public ZMQ.Socket getSocket(int index)
index
- the desired index.public long getTimeout()
public void setTimeout(long timeout)
timeout
- the desired poll timeout in milliseconds.public int getSize()
public int getNext()
public int 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).public boolean pollin(int index)
index
- public boolean pollout(int index)
index
- public boolean pollerr(int index)
index
- Copyright © 2017. All rights reserved.