public class NioClientManager extends com.google.common.util.concurrent.AbstractExecutionThreadService implements ClientConnectionManager
| Constructor and Description |
|---|
NioClientManager()
Creates a new client manager which uses Java NIO for socket management.
|
| Modifier and Type | Method and Description |
|---|---|
void |
closeConnections(int n)
Closes n peer connections
|
int |
getConnectedClientCount()
Gets the number of connected peers
|
void |
openConnection(SocketAddress serverAddress,
StreamParser parser)
Creates a new connection to the given address, with the given parser used to handle incoming data.
|
void |
run() |
void |
triggerShutdown() |
addListener, executor, getServiceName, isRunning, shutDown, start, startAndWait, startUp, state, stop, stopAndWait, toStringpublic NioClientManager()
public void run()
run in class com.google.common.util.concurrent.AbstractExecutionThreadServicepublic void openConnection(SocketAddress serverAddress, StreamParser parser)
ClientConnectionManageropenConnection in interface ClientConnectionManagerpublic void triggerShutdown()
triggerShutdown in class com.google.common.util.concurrent.AbstractExecutionThreadServicepublic int getConnectedClientCount()
ClientConnectionManagergetConnectedClientCount in interface ClientConnectionManagerpublic void closeConnections(int n)
ClientConnectionManagercloseConnections in interface ClientConnectionManagerCopyright © 2014. All rights reserved.