public class NioClientManager extends AbstractExecutionThreadService implements ClientConnectionManager
Service.Listener, Service.State| 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
|
protected Executor |
executor() |
int |
getConnectedClientCount()
Gets the number of connected peers
|
ListenableFuture<SocketAddress> |
openConnection(SocketAddress serverAddress,
StreamConnection connection)
Creates a new connection to the given address, with the given connection used to handle incoming data.
|
void |
run() |
void |
triggerShutdown() |
addListener, awaitRunning, awaitRunning, awaitTerminated, awaitTerminated, failureCause, isRunning, serviceName, shutDown, startAsync, startUp, state, stopAsync, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitaddListener, awaitRunning, awaitRunning, awaitTerminated, awaitTerminated, failureCause, isRunning, startAsync, state, stopAsyncpublic NioClientManager()
public void run()
run in class AbstractExecutionThreadServicepublic ListenableFuture<SocketAddress> openConnection(SocketAddress serverAddress, StreamConnection connection)
ClientConnectionManageropenConnection in interface ClientConnectionManagerpublic void triggerShutdown()
triggerShutdown in class AbstractExecutionThreadServicepublic int getConnectedClientCount()
ClientConnectionManagergetConnectedClientCount in interface ClientConnectionManagerpublic void closeConnections(int n)
ClientConnectionManagercloseConnections in interface ClientConnectionManagerprotected Executor executor()
executor in class AbstractExecutionThreadServiceCopyright © 2016. All rights reserved.