| Constructor and Description |
|---|
PollerImpl(ManagedContext context,
Map<Pollable,PollListener> pollableMap) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
disable(SelectableChannel channel)
Disable a channel in the poller, preventing it from waking up the thread
when messages are received on it.
|
boolean |
disable(Socket socket)
Disable a socket in the poller, preventing it from waking up the thread
when messages are received on it.
|
int |
enable(SelectableChannel channel)
Enable a channel in the poller after it has been disabled.
|
int |
enable(Socket socket)
Enable a socket in the poller after it has been disabled.
|
void |
poll()
Poll a socket indefinitely.
|
void |
poll(long timeoutMillis)
Poll a socket for a given amount of time.
|
int |
register(Pollable pollable,
PollListener listener)
Register a new poll item.
|
boolean |
unregister(SelectableChannel channel)
Unregister a channel from the poller.
|
boolean |
unregister(Socket socket)
Unregister a socket from the poller.
|
public PollerImpl(ManagedContext context, Map<Pollable,PollListener> pollableMap)
public void poll(long timeoutMillis)
Pollerpublic void poll()
Pollerpublic int enable(Socket socket)
Pollerpublic boolean disable(Socket socket)
Pollerpublic int enable(SelectableChannel channel)
Pollerpublic boolean disable(SelectableChannel channel)
Pollerpublic int register(Pollable pollable, PollListener listener)
Pollerpublic boolean unregister(Socket socket)
Pollerunregister in interface Pollersocket - The socket registered with the poller to be unregisteredpublic boolean unregister(SelectableChannel channel)
Pollerunregister in interface Pollerchannel - The channel registered with the poller to be unregisteredCopyright © 2019. All rights reserved.