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)
Poller
public void poll()
Poller
public int enable(Socket socket)
Poller
public boolean disable(Socket socket)
Poller
public int enable(SelectableChannel channel)
Poller
public boolean disable(SelectableChannel channel)
Poller
public int register(Pollable pollable, PollListener listener)
Poller
public boolean unregister(Socket socket)
Poller
unregister
in interface Poller
socket
- The socket registered with the poller to be unregisteredpublic boolean unregister(SelectableChannel channel)
Poller
unregister
in interface Poller
channel
- The channel registered with the poller to be unregisteredCopyright © 2019. All rights reserved.