org.zeromq
类 ZMQ.Poller

java.lang.Object
  继承者 org.zeromq.ZMQ.Poller
包容类:
ZMQ

public static class ZMQ.Poller
extends java.lang.Object

Inner class: Poller.


字段摘要
static int POLLERR
           
static int POLLIN
          These values can be ORed to specify what we want to poll for.
static int POLLOUT
           
 
构造方法摘要
  ZMQ.Poller(int size)
          Constructor
protected ZMQ.Poller(ZMQ.Context context)
          Class constructor.
protected ZMQ.Poller(ZMQ.Context context, int size)
          Class constructor.
 
方法摘要
 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()
          已过时。 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(java.nio.channels.SelectableChannel channel)
          Register a Channel for polling on all events.
 int register(java.nio.channels.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)
          已过时。 Timeout handling has been moved to the poll() methods.
 void unregister(java.nio.channels.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.
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

字段详细信息

POLLIN

public static final int POLLIN
These values can be ORed to specify what we want to poll for.

另请参见:
常量字段值

POLLOUT

public static final int POLLOUT
另请参见:
常量字段值

POLLERR

public static final int POLLERR
另请参见:
常量字段值
构造方法详细信息

ZMQ.Poller

public ZMQ.Poller(int size)
Constructor

参数:
size - the number of Sockets this poller will contain.

ZMQ.Poller

protected ZMQ.Poller(ZMQ.Context context)
Class constructor.

参数:
context - a 0MQ context previously created.

ZMQ.Poller

protected ZMQ.Poller(ZMQ.Context context,
                     int size)
Class constructor.

参数:
context - a 0MQ context previously created.
size - the number of Sockets this poller will contain.
方法详细信息

register

public int register(ZMQ.Socket socket)
Register a Socket for polling on all events.

参数:
socket - the Socket we are registering.
返回:
the index identifying this Socket in the poll set.

register

public int register(java.nio.channels.SelectableChannel channel)
Register a Channel for polling on all events.

参数:
channel - the Channel we are registering.
返回:
the index identifying this Channel in the poll set.

register

public int register(ZMQ.Socket socket,
                    int events)
Register a Socket for polling on the specified events. Automatically grow the internal representation if needed.

参数:
socket - the Socket we are registering.
events - a mask composed by XORing POLLIN, POLLOUT and POLLERR.
返回:
the index identifying this Socket in the poll set.

register

public int register(java.nio.channels.SelectableChannel channel,
                    int events)
Register a Channel for polling on the specified events. Automatically grow the internal representation if needed.

参数:
channel - the Channel we are registering.
events - a mask composed by XORing POLLIN, POLLOUT and POLLERR.
返回:
the index identifying this Channel in the poll set.

register

public int register(ZMQ.PollItem item)
Register a Channel for polling on the specified events. Automatically grow the internal representation if needed.

参数:
item - the PollItem we are registering.
返回:
the index identifying this Channel in the poll set.

unregister

public void unregister(ZMQ.Socket socket)
Unregister a Socket for polling on the specified events.

参数:
socket - the Socket to be unregistered

unregister

public void unregister(java.nio.channels.SelectableChannel channel)
Unregister a Channel for polling on the specified events.

参数:
channel - the Channel to be unregistered

getSocket

public ZMQ.Socket getSocket(int index)
Get the socket associated with an index.

参数:
index - the desired index.
返回:
the Socket associated with that index (or null).

getItem

public ZMQ.PollItem getItem(int index)
Get the PollItem associated with an index.

参数:
index - the desired index.
返回:
the PollItem associated with that index (or null).

getTimeout

public long getTimeout()
已过时。 Timeout handling has been moved to the poll() methods.

Get the current poll timeout.

返回:
the current poll timeout in microseconds.

setTimeout

public void setTimeout(long timeout)
已过时。 Timeout handling has been moved to the poll() methods.

Set the poll timeout.

参数:
timeout - the desired poll timeout in microseconds.

getSize

public int getSize()
Get the current poll set size.

返回:
the current poll set size.

getNext

public int getNext()
Get the index for the next position in the poll set size.

返回:
the index for the next position in the poll set size.

poll

public long poll()
Issue a poll call. If the poller's internal timeout value has been set, use that value as timeout; otherwise, block indefinitely.

返回:
how many objects where signalled by poll ().

poll

public int poll(long tout)
Issue a poll call, using the specified timeout value.

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).
返回:
how many objects where signalled by poll ()
另请参见:
2.1 docs, 3.0 docs

pollin

public boolean pollin(int index)
Check whether the specified element in the poll set was signalled for input.

参数:
index -
返回:
true if the element was signalled.

pollout

public boolean pollout(int index)
Check whether the specified element in the poll set was signalled for output.

参数:
index -
返回:
true if the element was signalled.

pollerr

public boolean pollerr(int index)
Check whether the specified element in the poll set was signalled for error.

参数:
index -
返回:
true if the element was signalled.

run_poll

protected static int run_poll(ZMQ.PollItem[] items,
                              int count,
                              long timeout)
Issue a poll call on the specified 0MQ items.

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).
返回:
how many objects where signalled by poll.
另请参见:
2.1 docs, 3.0 docs