org.apache.zookeeper.server
public static class NIOServerCnxn.Factory extends Thread
Thread.State, Thread.UncaughtExceptionHandler
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
Constructor and Description |
---|
NIOServerCnxn.Factory(InetSocketAddress addr)
Construct a new server connection factory which will accept an unlimited number
of concurrent connections from each client (up to the file descriptor
limits of the operating system).
|
NIOServerCnxn.Factory(InetSocketAddress addr,
int maxcc)
Constructs a new server connection factory where the number of concurrent connections
from a single IP address is limited to maxcc (or unlimited if 0).
|
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clear all the connections in the selector.
|
protected NIOServerCnxn |
createConnection(SocketChannel sock,
SelectionKey sk) |
InetSocketAddress |
getLocalAddress() |
int |
getLocalPort() |
int |
getMaxClientCnxns() |
ZooKeeperServer |
getZooKeeperServer() |
void |
run() |
void |
setZooKeeperServer(ZooKeeperServer zks) |
void |
shutdown() |
void |
start() |
void |
startup(ZooKeeperServer zks) |
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, stop, stop, suspend, toString, yield
public NIOServerCnxn.Factory(InetSocketAddress addr) throws IOException
port
- IOException
public NIOServerCnxn.Factory(InetSocketAddress addr, int maxcc) throws IOException
port
- - the port to listen on for connections.maxcc
- - the number of concurrent connections allowed from a single client.IOException
public void startup(ZooKeeperServer zks) throws IOException, InterruptedException
IOException
InterruptedException
public void setZooKeeperServer(ZooKeeperServer zks)
public ZooKeeperServer getZooKeeperServer()
public InetSocketAddress getLocalAddress()
public int getLocalPort()
public int getMaxClientCnxns()
protected NIOServerCnxn createConnection(SocketChannel sock, SelectionKey sk) throws IOException
IOException
public void clear()
public void shutdown()
Copyright © 2014 The Apache Software Foundation