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
|
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, awaitRunning, awaitRunning, awaitTerminated, awaitTerminated, executor, failureCause, isRunning, serviceName, shutDown, start, startAndWait, startAsync, startUp, state, stop, stopAndWait, stopAsync, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addListener, awaitRunning, awaitRunning, awaitTerminated, awaitTerminated, failureCause, isRunning, start, startAndWait, startAsync, state, stop, stopAndWait, stopAsync
public NioClientManager()
public void run()
run
in class AbstractExecutionThreadService
public void openConnection(SocketAddress serverAddress, StreamParser parser)
ClientConnectionManager
openConnection
in interface ClientConnectionManager
public void triggerShutdown()
triggerShutdown
in class AbstractExecutionThreadService
public int getConnectedClientCount()
ClientConnectionManager
getConnectedClientCount
in interface ClientConnectionManager
public void closeConnections(int n)
ClientConnectionManager
closeConnections
in interface ClientConnectionManager
Copyright © 2014. All rights reserved.